/* Studio Form – Create / Edit */

.iy-studio-form {
    max-width: 100%;
    padding: 0;
}

.iy-studio-form__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--iy-teal, #3b6063);
    text-decoration: none;
    margin-bottom: 12px;
}

.iy-studio-form__back:hover {
    text-decoration: underline;
}

/* Hide the WP page title when form is shown */
.page-template-default .entry-title,
.page-template-default .entry-header {
    display: none;
}

.iy-studio-form h2 {
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 700;
}

/* ── Tabs ──────────────────────────────────────────────── */

.iy-studio-form__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--bb-content-border-color, #e4e4e4);
    margin-bottom: 24px;
}

.iy-studio-form__tab,
.iy-studio-form__tab:focus,
.iy-studio-form__tab:active,
button.iy-studio-form__tab {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--bb-alternate-text-color, #888) !important;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
    box-shadow: none !important;
    outline: none !important;
}

.iy-studio-form__tab:hover,
button.iy-studio-form__tab:hover {
    color: var(--bb-body-text-color, #333) !important;
    background: none !important;
}

.iy-studio-form__tab.is-active,
button.iy-studio-form__tab.is-active {
    color: var(--iy-teal, #3b6063) !important;
    border-bottom-color: var(--iy-teal, #3b6063) !important;
    font-weight: 600 !important;
    background: none !important;
}

/* ── Panels ────────────────────────────────────────────── */

.iy-studio-form__panel {
    display: none;
}

.iy-studio-form__panel.is-active {
    display: block;
}

/* ── Gallery ───────────────────────────────────────────── */

.iy-studio-form__gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.iy-studio-form__gallery:empty {
    display: none;
}

.iy-studio-form__gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 12px; /* library input/tag radius */
    overflow: hidden;
}

.iy-studio-form__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.iy-studio-form__gallery-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    max-width: 22px;
    max-height: 22px;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #fff !important;
    border: none !important;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.iy-studio-form__gallery-item:hover .iy-studio-form__gallery-remove {
    opacity: 1;
}

.iy-studio-form__upload--gallery {
    padding: 16px;
}

/* Message */
.iy-studio-form__message {
    padding: 12px 16px;
    border-radius: 12px; /* library input/tag radius */
    margin-bottom: 16px;
    font-size: 14px;
}

.iy-studio-form__message--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.iy-studio-form__message--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Fields */
.iy-studio-form__field {
    margin-bottom: 20px;
}

.iy-studio-form__field > label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    color: #333;
}

.iy-studio-form__field input[type="text"],
.iy-studio-form__field input[type="url"],
.iy-studio-form__field input[type="email"],
.iy-studio-form__field input[type="tel"],
.iy-studio-form__field textarea,
#iy-form-teacher-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* library input/tag radius */
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.iy-studio-form__field input:focus,
.iy-studio-form__field textarea:focus,
#iy-form-teacher-search:focus {
    outline: none;
    border-color: var(--iy-teal, #3B6063);
    box-shadow: 0 0 0 2px rgba(59, 96, 99, 0.1);
}

.iy-studio-form__field textarea {
    resize: vertical;
}

/* Row (side-by-side fields) */
.iy-studio-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Upload area */
.iy-studio-form__upload {
    border: 2px dashed #ddd;
    border-radius: 12px; /* library input/tag radius */
    padding: 24px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

.iy-studio-form__upload:hover {
    border-color: var(--iy-teal, #3B6063);
}

.iy-studio-form__upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.iy-studio-form__upload span {
    font-size: 14px;
    color: #888;
}

.iy-studio-form__preview {
    margin-top: 12px;
}

.iy-studio-form__preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 12px; /* library input/tag radius */
    object-fit: cover;
}

/* Checkboxes */
.iy-studio-form__checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.iy-studio-form__checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* Hint text */
.iy-studio-form__hint {
    font-size: 12px;
    color: #888;
    margin: 0 0 8px 0;
}

/* Teacher search results dropdown */
.iy-studio-form__teacher-results {
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* library input/tag radius */
    max-height: 200px;
    overflow-y: auto;
    display: none;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-top: 4px;
}

.iy-studio-form__teacher-results.is-visible {
    display: block;
}

.iy-studio-form__teacher-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.iy-studio-form__teacher-result:hover {
    background: #f5f5f6;
}

.iy-studio-form__teacher-result img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.iy-studio-form__teacher-result-name {
    font-size: 14px;
    font-weight: 500;
}

.iy-studio-form__teacher-result-level {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

/* Teacher tags */
.iy-studio-form__teacher-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.iy-studio-form__teacher-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--bb-content-border-color, #e4e4e4);
    border-radius: 100px;
    padding: 5px 12px;
    font-size: 13px;
}

.iy-studio-form__teacher-tag button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #888;
    padding: 0;
    display: flex;
    align-items: center;
}

.iy-studio-form__teacher-tag button:hover {
    color: #333;
}

.iy-studio-form__teacher-owner {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--iy-gold, #A77637);
    margin-left: 2px;
}

/* Actions */
.iy-studio-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.iy-studio-form__status-note {
    margin: -6px 0 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--iy-gold-soft, #F3E9DB);
    color: var(--iy-ink, #1d2b2a);
    font-size: 13.5px;
    line-height: 1.5;
}

.iy-studio-form__submit--draft {
    background: transparent !important;
    color: var(--iy-teal, #3B6063) !important;
    border: 1px solid var(--iy-teal, #3B6063) !important;
}

.iy-studio-form__submit--draft:hover {
    background: var(--iy-teal-soft, #EAF0EF) !important;
}

.iy-studio-form__cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: 1px solid #ddd;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: border-color 0.2s;
}

.iy-studio-form__cancel:hover {
    border-color: #999;
    color: #333;
    text-decoration: none;
}

.iy-studio-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--iy-teal, #3B6063);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.iy-studio-form__submit:hover {
    opacity: 0.9;
}

.iy-studio-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Upsell / License Page ───────────────────────────────── */

.iy-studio-upsell {
    max-width: 100%;
    padding: 24px 0;
}

.iy-studio-upsell__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--iy-teal, #3b6063);
    margin-bottom: 8px;
}

.iy-studio-upsell h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.iy-studio-upsell__intro {
    color: #666;
    font-size: 15px;
    margin-bottom: 40px;
    max-width: 520px;
}

.iy-studio-upsell__plans {
    display: grid;
    /* two plans since the Basic tier was abolished (2026-07-20) */
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 860px;
}

.iy-studio-upsell__plan {
    background: #fff;
    border: 1px solid var(--bb-content-border-color, #e4e4e4);
    border-radius: 12px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
}

.iy-studio-upsell__plan-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-headings-color, #1a1a1a);
    margin: 0 0 24px;
    padding: 0;
}

.iy-studio-upsell__plan-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--bb-headings-color, #1a1a1a);
    margin-bottom: 4px;
    line-height: 1.1;
}

.iy-studio-upsell__plan-price span {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

.iy-studio-upsell__btn {
    display: block;
    text-align: center;
    padding: 10px 20px;
    border-radius: 12px; /* library input/tag radius */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-top: 24px;
    background: var(--iy-teal, #3b6063);
    color: #fff;
    border: none;
}

.iy-studio-upsell__btn:hover {
    background: color-mix(in srgb, var(--iy-teal, #3b6063) 85%, #000);
    color: #fff;
}

.iy-studio-upsell__btn--primary {
    background: var(--iy-gold, #A77637);
}

.iy-studio-upsell__btn--primary:hover {
    background: color-mix(in srgb, var(--iy-gold, #A77637) 85%, #000);
    color: #fff;
}

.iy-studio-upsell__plan-desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--bb-headings-color, #1a1a1a);
    margin-top: 24px;
    margin-bottom: 0;
    padding-bottom: 0;
}

.iy-studio-upsell__features {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    flex: 1;
}

.iy-studio-upsell__features li {
    padding: 5px 0;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.iy-studio-upsell__features li::before {
    content: '';
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%233b6063'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Responsive */
@media (max-width: 768px) {
    .iy-studio-form {
        padding: 16px;
    }

    .iy-studio-upsell__plans {
        grid-template-columns: 1fr;
    }


    .iy-studio-form__row {
        grid-template-columns: 1fr;
    }

    .iy-studio-form__actions {
        flex-direction: column-reverse;
    }

    .iy-studio-form__cancel,
    .iy-studio-form__submit {
        width: 100%;
        text-align: center;
    }
}

/* ── Phones (≤ 640px, ticket 3 mobile pass 2026-10-12) ─────────────────────
   Twin of the event form: tabs as equal columns (no row past the screen
   edge), 16px fields so iOS does not zoom on focus, 44px actions. */
@media (max-width: 640px) {
    .iy-studio-form__tab,
    .iy-studio-form__tab:focus,
    .iy-studio-form__tab:active,
    button.iy-studio-form__tab {
        flex: 1 1 0;
        min-width: 0;
        min-height: 48px;
        padding: 8px 4px !important;
        font-size: 13px !important;
        line-height: 1.25 !important;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .iy-studio-form__field > label {
        font-size: 13px;
    }

    .iy-studio-form__field input[type="text"],
    .iy-studio-form__field input[type="url"],
    .iy-studio-form__field input[type="email"],
    .iy-studio-form__field input[type="tel"],
    .iy-studio-form__field textarea,
    #iy-form-teacher-search {
        min-height: 44px;
        font-size: 16px;
    }

    .iy-studio-form__hint {
        font-size: 14px;
    }

    .iy-studio-form__cancel,
    .iy-studio-form__submit {
        min-height: 44px;
    }
}

/* Touch screens have no hover: the gallery "remove" button stayed invisible. */
@media (hover: none) {
    .iy-studio-form__gallery-remove {
        opacity: 1;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        max-height: 32px;
        font-size: 18px;
    }
}
