/*
 * Eventit Events - admin styling
 * Follows the native WordPress admin design language (no Bootstrap).
 */

.eventit-admin {
    max-width: 1200px;
}

.eventit-admin .eventit-admin-logo {
    max-height: 36px;
    display: block;
    margin: 16px 0 8px;
}

.eventit-admin .notice.inline {
    margin: 16px 0;
}

/* Cards */
.eventit-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    padding: 16px 20px 20px;
    margin-top: 16px;
}

.eventit-card > h2 {
    margin: 0 0 4px;
    padding: 0;
    font-size: 15px;
    line-height: 1.6;
}

.eventit-card .description {
    margin-top: 0;
    color: #646970;
}

/* Two column layout */
.eventit-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 960px) {
    .eventit-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Option rows (appearance form) */
.eventit-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
}

.eventit-option-row:last-of-type {
    border-bottom: 0;
}

.eventit-option-label {
    font-weight: 600;
}

/* Category checkbox list */
.eventit-category-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    padding: 6px 12px;
    margin: 8px 0;
}

.eventit-category-option {
    display: block;
    padding: 4px 0;
}

/* Shortcode output + copy */
.eventit-shortcode-output {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.eventit-shortcode-output code {
    font-size: 13px;
    padding: 8px 12px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.eventit-copy-feedback {
    color: #00a32a;
    font-weight: 600;
    display: none;
}

/* Ready-state panel on the setup page */
.eventit-ready-panel {
    text-align: center;
}

.eventit-ready-panel img {
    max-width: 90px;
    margin: 8px auto 0;
}

/* Option rows: secondary hint under the label */
.eventit-option-label small {
    display: block;
    font-weight: 400;
    color: #646970;
    font-size: 12px;
    margin-top: 2px;
}

.eventit-option-row.eventit-option-muted {
    opacity: .45;
}

.eventit-option-row select {
    max-width: 260px;
}

.eventit-range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.eventit-range-wrap input[type="range"] {
    width: 150px;
}

.eventit-range-wrap output {
    min-width: 22px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Collapsible sections */
.eventit-section {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin: 10px 0;
    background: #fff;
}

.eventit-section > summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.eventit-section > summary::-webkit-details-marker {
    display: none;
}

.eventit-section > summary::before {
    content: "\f140";
    font-family: dashicons;
    font-size: 18px;
    line-height: 1;
    color: #787c82;
    transition: transform .15s ease;
}

.eventit-section[open] > summary::before {
    transform: rotate(180deg);
}

.eventit-section[open] > summary {
    border-bottom: 1px solid #f0f0f1;
}

.eventit-section-body {
    padding: 4px 14px 12px;
}

.eventit-section-body .eventit-option-row:last-child {
    border-bottom: 0;
}

.eventit-section-body textarea.code {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    margin-top: 6px;
}

.eventit-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.eventit-form-actions .submit {
    margin: 0;
    padding: 0;
}

.eventit-reset-button {
    color: #b32d2e;
}

/* Builder card stays visible while scrolling the long form */
.eventit-builder-card {
    position: sticky;
    top: 48px;
}

/*
 * Live preview area on the shortcode page.
 *
 * The preview is an iframe that loads exactly the same stylesheets as the
 * frontend, so what is shown here matches the live site 1:1. Nothing about the
 * event markup is styled from this file - only the frame around it.
 */
.eventit-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.eventit-preview-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.eventit-preview-widths {
    display: inline-flex;
}

.eventit-preview-widths .button {
    border-radius: 0;
    margin-left: -1px;
}

.eventit-preview-widths .button:first-child {
    border-radius: 3px 0 0 3px;
    margin-left: 0;
}

.eventit-preview-widths .button:last-child {
    border-radius: 0 3px 3px 0;
}

.eventit-preview-widths .button.is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    z-index: 1;
}

.eventit-preview-bg-toggle {
    white-space: nowrap;
    color: #646970;
}

.eventit-preview {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px;
    margin-top: 12px;
    transition: background .15s ease;
}

.eventit-preview.eventit-preview-on-dark {
    background: #15181f;
}

/*
 * The stage keeps the layout height. The frame inside is sized to the emulated
 * device width (1280 / 820 / 390) and scaled down with a transform, so the
 * media and container queries see a real device width - showing 3 boxed columns
 * on desktop instead of the 2 that the narrower admin column would trigger.
 */
.eventit-preview-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 520px;
}

.eventit-preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 520px;
    border: 0;
    display: block;
    color-scheme: light;
    transform-origin: top left;
}

/* the column count that matches the saved setting */
.eventit-preview-layout.is-default::after {
    content: "\2022";
    margin-left: 5px;
    color: #2271b1;
}

.eventit-preview-layout.is-default.is-active::after {
    color: #fff;
}

.eventit-preview-scale {
    color: #646970;
    font-size: 12px;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   "Lav shortcode" page
   ------------------------------------------------------------------ */
.eventit-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1100px) {
    .eventit-builder-layout {
        grid-template-columns: 1fr;
    }
}

.eventit-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.eventit-pick-counter {
    flex: 0 0 auto;
    background: #f0f0f1;
    color: #50575e;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.eventit-pick-counter.is-active {
    background: #2271b1;
    color: #fff;
}

/* Toolbar */
.eventit-picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 8px;
}

.eventit-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.eventit-picker-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.eventit-show-past {
    color: #646970;
    font-size: 13px;
}

/* Event rows */
.eventit-event-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
}

.eventit-event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f1;
    cursor: pointer;
    transition: background .12s ease;
}

.eventit-event-row:last-of-type {
    border-bottom: 0;
}

.eventit-event-row:hover {
    background: #f6f7f7;
}

.eventit-event-row input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
}

.eventit-event-row:has(input:checked) {
    background: #f0f6fc;
}

.eventit-event-date {
    flex: 0 0 auto;
    width: 44px;
    text-align: center;
    line-height: 1.1;
    color: #1d2327;
}

.eventit-event-day {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.eventit-event-month {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #646970;
}

.eventit-event-main {
    flex: 1 1 auto;
    min-width: 0;
}

.eventit-event-name {
    display: block;
    font-weight: 600;
    color: #1d2327;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eventit-event-meta {
    display: block;
    font-size: 12px;
    color: #646970;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eventit-event-tags {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 40%;
}

.eventit-event-tag {
    background: #f0f0f1;
    color: #50575e;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 11px;
    white-space: nowrap;
}

.eventit-event-tag.is-past-tag {
    background: #fcf0f1;
    color: #b32d2e;
}

.eventit-event-row.is-past .eventit-event-day,
.eventit-event-row.is-past .eventit-event-name {
    color: #787c82;
}

.eventit-no-hits {
    display: none;
    margin: 0;
    padding: 18px 14px;
    color: #646970;
    text-align: center;
}

/* Result panel */
.eventit-result-card {
    position: sticky;
    top: 48px;
}

.eventit-result-card .eventit-shortcode-output {
    display: block;
}

.eventit-result-card code {
    display: block;
    width: 100%;
    box-sizing: border-box;
    word-break: break-all;
    line-height: 1.6;
}

.eventit-result-card .eventit-copy-shortcode {
    margin-top: 10px;
    width: 100%;
}

.eventit-result-summary {
    margin: 14px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #f0f0f1;
    color: #50575e;
    font-size: 13px;
}

.eventit-result-summary li {
    margin: 0 0 6px;
    padding-left: 18px;
    position: relative;
}

.eventit-result-summary li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2271b1;
}

/* The styling page form spans the full width now that the builder has its own page */
.eventit-styling-form .eventit-card {
    max-width: 100%;
}

.eventit-styling-form .eventit-section-body {
    column-gap: 32px;
}

@media (min-width: 1200px) {
    .eventit-styling-form .eventit-section-body {
        columns: 2;
    }
    .eventit-styling-form .eventit-option-row {
        break-inside: avoid;
    }
    .eventit-styling-form .eventit-section-body > .description,
    .eventit-styling-form .eventit-section-body > label,
    .eventit-styling-form .eventit-section-body > textarea {
        break-inside: avoid;
    }
}
