/* ==========================================================================
   THE AVIATORS — 3D FLIPBOOK & MAGAZINE STYLESHEET
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Magazine Showcase & 3D Book Cards
   -------------------------------------------------------------------------- */
.magazine-hero {
    background: linear-gradient(135deg, #051427 0%, #0a2544 55%, #123d6a 100%);
    color: #fff;
    padding: 110px 7vw 90px;
    position: relative;
    overflow: hidden;
}

.magazine-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(244, 196, 48, 0.15), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(8, 182, 214, 0.1), transparent 60%);
    pointer-events: none;
}

.magazine-hero h1 {
    font: 400 clamp(44px, 5.5vw, 76px)/1.05 Georgia, serif;
    letter-spacing: -0.035em;
    margin: 0 0 20px;
}

.magazine-hero h1 span {
    color: var(--accent, #F4C430);
}

.magazine-hero p {
    max-width: 680px;
    color: #c9d7de;
    font-size: 16px;
    line-height: 1.75;
    margin: 0;
}

.magazine-showcase-section {
    padding: clamp(60px, 8vw, 110px) 7vw;
    background: #f8f6f0;
}

.magazine-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.magazine-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(7, 27, 54, 0.08);
    box-shadow: 0 16px 45px rgba(7, 27, 54, 0.07);
    padding: 36px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.magazine-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(7, 27, 54, 0.14);
}

/* 3D Realistic Book Mockup */
.book-mockup-wrap {
    perspective: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-3d {
    width: 170px;
    height: 240px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-18deg) rotateX(6deg);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
}

.magazine-card:hover .book-3d {
    transform: rotateY(-6deg) rotateX(2deg) scale(1.04);
}

.book-cover {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #071B36 0%, #153860 100%);
    border-radius: 4px 10px 10px 4px;
    box-shadow: 5px 8px 25px rgba(0, 0, 0, 0.35);
    padding: 18px 14px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border-left: 5px solid #041021;
}

.book-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 12%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

.book-cover-badge {
    align-self: flex-start;
    background: var(--accent, #F4C430);
    color: #071B36;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 4px;
}

.book-cover-title {
    font: 700 15px/1.2 Georgia, serif;
    color: #fff;
    margin: 10px 0 4px;
}

.book-cover-subtitle {
    font-size: 8.5px;
    color: #ffd86b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.book-cover-icon {
    font-size: 26px;
    align-self: flex-end;
    color: rgba(244, 196, 48, 0.8);
}

.book-spine-effect {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(90deg, rgba(0,0,0,0.5) 0%, rgba(255,255,255,0.15) 50%, rgba(0,0,0,0.25) 100%);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
}

.book-pages-side {
    position: absolute;
    right: -10px;
    top: 4px;
    bottom: 4px;
    width: 10px;
    background: repeating-linear-gradient(0deg, #f5ecd7, #f5ecd7 1px, #d8ceb8 1px, #d8ceb8 2px);
    transform: rotateY(90deg) translateZ(-5px);
    border-radius: 0 2px 2px 0;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.2);
}

/* Card Content */
.magazine-card-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.magazine-tag {
    display: inline-block;
    color: #071B36;
    background: #ffeaa7;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    align-self: flex-start;
}

.magazine-card-info h3 {
    font: 400 24px/1.25 Georgia, serif;
    color: #071B36;
    margin: 0;
}

.magazine-meta-line {
    font-size: 11px;
    color: #718690;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-weight: 600;
}

.magazine-meta-line span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.magazine-card-info p {
    font-size: 13px;
    line-height: 1.65;
    color: #4a5d66;
    margin: 0;
}

.magazine-highlights-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.magazine-highlights-list li {
    font-size: 11.5px;
    color: #3b4e57;
    position: relative;
    padding-left: 16px;
}

.magazine-highlights-list li::before {
    content: '✈';
    position: absolute;
    left: 0;
    color: var(--accent, #F4C430);
    font-size: 9px;
}

.magazine-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn-flipbook {
    background: #071B36;
    color: #F4C430 !important;
    border: 1px solid rgba(244, 196, 48, 0.4);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 13px 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(7, 27, 54, 0.2);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-flipbook:hover {
    background: #0d2a50;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(7, 27, 54, 0.3);
}

.btn-pdf-download {
    background: #f0f4f6;
    color: #071B36 !important;
    border: 1px solid #d5e0e4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 13px 18px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-pdf-download:hover {
    background: #e2ebef;
    color: #071B36 !important;
}

/* --------------------------------------------------------------------------
   2. 3D Flipbook Modal & Standalone Viewer
   -------------------------------------------------------------------------- */
.flipbook-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(3, 13, 26, 0.94);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.flipbook-modal.is-active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.flipbook-header {
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 27, 54, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    flex-shrink: 0;
}

.flipbook-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.flipbook-badge {
    background: var(--accent, #F4C430);
    color: #071B36;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

.flipbook-title {
    font: 600 16px Georgia, serif;
    color: #fff;
    margin: 0;
    max-width: 50vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flipbook-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flipbook-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    text-decoration: none;
}

.flipbook-btn-icon:hover {
    background: rgba(244, 196, 48, 0.25);
    color: var(--accent, #F4C430);
    transform: scale(1.05);
}

.flipbook-close {
    font-size: 22px;
    line-height: 1;
}

/* Flipbook Stage & Canvas Container */
.flipbook-stage {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 20px 40px;
    touch-action: pan-y;
}

.flipbook-container {
    position: relative;
    max-width: 92vw;
    max-height: 74vh;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    transition: transform 0.3s ease;
}

/* The StPageFlip Book Element */
.st-flip-book {
    margin: auto;
    background: transparent;
    border-radius: 4px;
}

.st-flip-page {
    background-color: #fbf9f4;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.06);
    overflow: hidden;
    position: relative;
}

.st-flip-page canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

.st-flip-page[data-density="hard"] {
    background: linear-gradient(135deg, #071B36, #123d6a);
    color: #fff;
}

/* Page Spine & Realistic Gutter Shading */
.flipbook-spine-shadow {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 36px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0.02) 40%, rgba(0,0,0,0.02) 60%, rgba(0,0,0,0.22) 100%);
    pointer-events: none;
    z-index: 10;
}

/* Loading Overlay */
.flipbook-loading {
    position: absolute;
    inset: 0;
    background: rgba(4, 16, 32, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 50;
    gap: 18px;
}

.flipbook-radar-loader {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid rgba(244, 196, 48, 0.3);
    position: relative;
    background: radial-gradient(circle, rgba(244, 196, 48, 0.1) 0%, transparent 70%);
}

.flipbook-radar-loader::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border-top: 3px solid var(--accent, #F4C430);
    animation: flipbook-spin 1s linear infinite;
}

@keyframes flipbook-spin {
    to { transform: rotate(360deg); }
}

.flipbook-loading p {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #dbe4e8;
    margin: 0;
}

.flipbook-progress-bar {
    width: 220px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.flipbook-progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent, #F4C430);
    transition: width 0.2s ease;
}

/* Navigation Arrow Overlays on the Sides */
.flipbook-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(7, 27, 54, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    user-select: none;
}

.flipbook-nav-arrow:hover {
    background: var(--accent, #F4C430);
    color: #071B36;
    transform: translateY(-50%) scale(1.1);
}

.flipbook-nav-prev {
    left: 20px;
}

.flipbook-nav-next {
    right: 20px;
}

/* Bottom Floating Control Bar */
.flipbook-toolbar {
    height: 60px;
    background: rgba(7, 27, 54, 0.88);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 20px;
    flex-shrink: 0;
    color: #fff;
    position: relative;
    z-index: 30;
}

.flipbook-page-slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flipbook-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.flipbook-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #F4C430);
    cursor: pointer;
}

.flipbook-page-counter {
    font-size: 12px;
    color: #c9d7de;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.flipbook-page-counter input {
    width: 36px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 12px;
    font-weight: 700;
}

.flipbook-toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
}

.flipbook-tool-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d8e4e9;
    border-radius: 6px;
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.flipbook-tool-btn:hover {
    background: rgba(244, 196, 48, 0.2);
    color: var(--accent, #F4C430);
}

.flipbook-tool-btn.is-active {
    background: var(--accent, #F4C430);
    color: #071B36;
}

/* Thumbnail Drawer Tray */
.flipbook-thumbnails-tray {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(4, 16, 32, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 20px;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    z-index: 25;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--accent, #F4C430) rgba(255,255,255,0.1);
}

.flipbook-thumbnails-tray.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.flipbook-thumb-item {
    flex: 0 0 auto;
    width: 85px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.flipbook-thumb-item:hover,
.flipbook-thumb-item.is-current {
    opacity: 1;
    transform: scale(1.06);
}

.flipbook-thumb-item.is-current canvas {
    border: 2px solid var(--accent, #F4C430);
    box-shadow: 0 0 10px rgba(244, 196, 48, 0.5);
}

.flipbook-thumb-item canvas {
    width: 85px;
    height: 115px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.flipbook-thumb-item span {
    font-size: 10px;
    color: #c0cfd6;
    font-weight: 600;
}

/* Standalone Flipbook Page View */
.flipbook-standalone-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #071526;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   3. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .magazine-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .magazine-card {
        grid-template-columns: 1fr;
        padding: 24px;
        text-align: center;
    }
    
    .book-mockup-wrap {
        margin: 0 auto 10px;
    }
    
    .magazine-tag {
        align-self: center;
    }
    
    .magazine-actions {
        justify-content: center;
    }
    
    .flipbook-header {
        height: 54px;
        padding: 0 14px;
    }
    
    .flipbook-title {
        max-width: 40vw;
        font-size: 13px;
    }
    
    .flipbook-slider {
        display: none;
    }
    
    .flipbook-nav-arrow {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .flipbook-nav-prev {
        left: 8px;
    }
    
    .flipbook-nav-next {
        right: 8px;
    }
    
    .flipbook-toolbar {
        padding: 0 8px;
        gap: 8px;
    }
    
    .flipbook-tool-btn span {
        display: none;
    }
}
