/**
 * format.css
 * Screen 2: Format — 9:16 / 16:9 video format selector
 * Architecture: .format-layout container (structural, like .hero in welcome)
 * Layout: [option 9:16] [option 16:9] [SIGUIENTE →]
 * Sizing: both containers share same short-side dimension (D)
 *   Portrait:  width = D, aspect-ratio 9/16
 *   Landscape: height = D, aspect-ratio 16/9
 *   D = (available_hero_height - labels) * 9/16
 */

/* ═══ LAYOUT CONTAINER ═══ */
/* fm-main = 100vh - 110px (header 70 + footer 40) */
/* padding-top = nav(48px) + gap(5px) = 53px */
.format-layout {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 0;
    width: 100%;
    height: 100%;
    flex: 1;
    align-self: stretch;
    padding: 53px 2.5rem 5px;
}

/* ═══ FORMAT OPTION ═══ */
/* Flex ROW: thumb-col (check+thumb+label) + platforms side by side */
.format-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}


/* Thumb column: check + container + label, centered */
.format-thumb-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ═══ THUMBNAIL CONTAINER ═══ */
/* D = short side, shared by both (same rectangle, rotated) */
/* H = 100vh - 224px (available for thumb) */
/* D = H * 9/16 = (100vh - 224px) * 9/16 */
.format-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1e;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.format-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* 9:16 Portrait — width = D, height = H (from aspect-ratio) */
.format-thumb-portrait {
    width: calc((100vh - 224px) * 9 / 16);
    aspect-ratio: 9/16;
}

/* 16:9 Landscape — height = D (same short side), width from aspect-ratio */
.format-thumb-landscape {
    height: calc((100vh - 224px) * 9 / 16);
    aspect-ratio: 16/9;
}

/* ═══ SELECT BUTTON (checkmark) ═══ */
/* 20% smaller than 24px = 19px */
.format-check {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.format-option:hover .format-check {
    border-color: rgba(255, 255, 255, 0.4);
}

.format-option.selected .format-check {
    background: #fff;
    border-color: #fff;
}

.format-check svg {
    width: 11px;
    height: 11px;
    color: transparent;
    transition: color 0.3s;
}

.format-option.selected .format-check svg {
    color: #000;
}

/* ═══ HOVER & SELECTED STATES ═══ */
.format-option:hover .format-thumb {
    border-color: rgba(255, 255, 255, 0.25);
}

.format-option.selected .format-thumb {
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Dim unselected when one is selected */
.format-layout.has-selection .format-option:not(.selected) .format-thumb img {
    opacity: 0.45;
}

.format-layout.has-selection .format-option:not(.selected) {
    transform: scale(0.97);
}

/* ═══ FORMAT LABEL (below container) ═══ */
.format-ratio {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: -0.04em;
    transition: color 0.3s;
}

.format-option.selected .format-ratio {
    color: #fff;
}

/* ═══ PLATFORM INFO (right of container) ═══ */
.format-platforms {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.format-platform-icons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.format-platform-icons svg {
    width: 14px;
    height: 14px;
    fill: rgba(255, 255, 255, 0.6);
    transition: fill 0.3s;
}

.format-option.selected .format-platform-icons svg {
    fill: rgba(255, 255, 255, 0.75);
}

.format-platform-text {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.3s;
}

.format-option.selected .format-platform-text {
    color: rgba(255, 255, 255, 0.65);
}

/* ═══ ACTION COLUMN (right — SIGUIENTE) ═══ */
.format-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.format-hint {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.6;
    max-width: 200px;
}

.format-submit {
    border-radius: 1rem;
    padding: 0.85rem 3.5rem;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    color: #000;
    font-weight: 800;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.3;
    pointer-events: none;
    white-space: nowrap;
}

.format-submit.enabled {
    opacity: 1;
    pointer-events: auto;
}

.format-submit.enabled:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* ═══ SHAKE ANIMATION (validation) ═══ */
@keyframes formatShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.format-option.shake {
    animation: formatShake 0.4s ease;
}

/* ═══ TABLET (768px) ═══ */
@media (max-width: 768px) {
    .format-layout {
        gap: 1.5rem;
        padding: 53px 1.5rem 5px;
    }

    .format-thumb-portrait {
        width: calc((100vh - 224px) * 9 / 16);
    }

    .format-thumb-landscape {
        height: calc((100vh - 224px) * 9 / 16);
    }

    .format-ratio {
        font-size: 11px;
    }

    .format-submit {
        padding: 0.75rem 1.5rem;
    }
}

/* ═══ MOBILE (480px) — stack vertical ═══ */
@media (max-width: 480px) {
    .format-layout {
        flex-direction: column;
        align-items: center;
        justify-content: space-evenly;
        gap: 0;
        padding: 53px 1.5rem 5px;
    }

    .format-thumb-portrait {
        width: calc((100vh - 224px) * 9 / 16 * 0.38);
    }

    .format-thumb-landscape {
        height: calc((100vh - 224px) * 9 / 16 * 0.38);
    }

    .format-action {
        width: 100%;
    }

    .format-submit {
        width: 100%;
    }
}
