/* 3D Models Gallery Styles - ABL Films Photogrammetry Showcase */

/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, #6EC1E4 0%, #2B4080 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

.title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: #f2f2f2;
    margin: 0;
    transform: rotate(-2deg);
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #FFD700;
    margin-top: 15px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 40px;
    padding: 80px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .models-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 20px;
    }
}

/* Model Card */
.model-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
    animation: fadeInUp 0.6s ease both;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.model-card:hover {
    transform: translateY(-12px) rotate(1deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Model Viewer Container */
.model-viewer-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #2B4080 0%, #1a2850 50%, #2B4080 100%);
    overflow: hidden;
}

.model-viewer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(110, 193, 228, 0.3), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

model-viewer {
    width: 100%;
    height: 100%;
    background: transparent;
    --poster-color: transparent;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

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

/* AR Button */
.ar-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #FFD700;
    color: #2B4080;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ar-button:hover {
    background: #FFC700;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.ar-button:active {
    transform: scale(0.98);
}

/* Model Info */
.model-info {
    padding: 24px;
    background: rgba(43, 64, 128, 0.95);
    backdrop-filter: blur(15px);
    border-top: 2px solid rgba(255, 215, 0, 0.3);
}

.model-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f2f2f2;
    margin: 0 0 10px 0;
    transform: rotate(-1deg);
}

.model-description {
    font-size: 1rem;
    color: rgba(242, 242, 242, 0.85);
    margin: 0;
    line-height: 1.6;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(43, 64, 128, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #f2f2f2;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: #FFD700;
    color: #2B4080;
    transform: scale(1.1) rotate(5deg);
    border-color: #FFD700;
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn svg {
    width: 24px;
    height: 24px;
}

/* Fullscreen Modal */
.model-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 900px;
    background: linear-gradient(135deg, rgba(43, 64, 128, 0.6) 0%, rgba(26, 40, 80, 0.6) 100%);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 107, 107, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #f2f2f2;
    font-size: 2rem;
    font-weight: 300;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    background: #FF6B6B;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.6);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-content model-viewer {
    flex: 1;
    min-height: 0;
}

.modal-info {
    padding: 30px 40px;
    background: rgba(43, 64, 128, 0.95);
    backdrop-filter: blur(20px);
    text-align: center;
    border-top: 2px solid rgba(255, 215, 0, 0.4);
}

.modal-info h2 {
    font-size: 2rem;
    color: #FFD700;
    margin: 0 0 12px 0;
    font-weight: 700;
    transform: rotate(-1deg);
}

.modal-info p {
    font-size: 1.15rem;
    color: rgba(242, 242, 242, 0.9);
    margin: 0;
    line-height: 1.6;
}

/* Clean modal without info bar */
.modal-content-clean {
    max-height: 90vh;
    border-radius: 16px;
}

.modal-content-clean model-viewer {
    border-radius: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Error Message */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px 40px;
    background: rgba(255, 107, 107, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 80%;
    z-index: 20;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hero {
        padding: 80px 20px 50px;
    }

    .models-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 40px 15px;
    }

    .model-card {
        border-radius: 16px;
    }

    .model-info {
        padding: 20px;
    }

    .model-title {
        font-size: 1.2rem;
    }

    .model-description {
        font-size: 0.95rem;
    }

    .fullscreen-btn {
        padding: 10px;
        top: 15px;
        right: 15px;
    }

    .fullscreen-btn svg {
        width: 20px;
        height: 20px;
    }

    .ar-button {
        padding: 10px 20px;
        font-size: 0.85rem;
        bottom: 15px;
        right: 15px;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: 20px;
    }

    .modal-info {
        padding: 20px 25px;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }

    .modal-info p {
        font-size: 1rem;
    }

    .close-btn {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
        top: 15px;
        right: 15px;
    }
}

/* High-DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .model-card {
        border-width: 0.5px;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .model-card,
    .spinner,
    .hero::before {
        animation: none;
    }

    .model-card {
        opacity: 1;
    }

    .model-card:hover,
    .fullscreen-btn:hover,
    .ar-button:hover {
        transform: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    /* Already dark-themed, but can add adjustments here */
}

/* Section Title Centered */
.section-title-centered {
    text-align: center;
    margin-bottom: 2rem;
}

/* Models Section Container */
.models-section {
    padding: 60px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Print styles */
@media print {
    .ar-button,
    .fullscreen-btn,
    .close-btn {
        display: none;
    }

    .model-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
