/* ========================================
   GLOBAL STYLES & VARIABLES
   ======================================== */

:root {
    --blue: #0A3D62;
    --white: #FFFFFF;
    --gold: #D4AF37;
    --gray: #7F8C8D;
    --black: #000000;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--black);
    background-color: #f8f9fa;
    background-image: 
        linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-attachment: scroll;
    background-repeat: repeat;
    min-height: 100%;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 3px 3px, rgba(212, 175, 55, 0.4) 2px, transparent 0),
        radial-gradient(circle at 3px 3px, rgba(10, 61, 98, 0.25) 1.5px, transparent 0);
    background-size: 50px 50px, 80px 80px;
    background-position: 0 0, 25px 25px;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(212, 175, 55, 0.2) 1px, transparent 0);
    background-size: 30px 30px;
    background-position: 15px 15px;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

.lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid var(--blue);
    background: var(--white);
    color: var(--blue);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
}

.lang-btn:hover {
    background: var(--blue);
    color: var(--white);
    transform: scale(1.05);
}

.lang-btn.active {
    background: var(--blue);
    color: var(--white);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    background: linear-gradient(135deg, var(--blue) 0%, #1565C0 100%);
    color: var(--white);
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-in;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
    animation: slideDown 0.8s ease-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

.hero-intro {
    font-size: 1rem;
    opacity: 0.95;
    animation: slideUp 0.8s ease-out 0.2s both;
}

/* ========================================
   OBJECTS GRID (INDEX PAGE)
   ======================================== */

.objects-section {
    padding: 80px 20px 100px;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2.5rem;
    color: var(--blue);
    text-align: center;
    margin-bottom: 50px;
    font-weight: 700;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gold);
    border-radius: 2px;
}

.objects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.object-card {
    background: var(--white);
    border: 2px solid var(--gray);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--black);
    display: block;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out both;
}

.object-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s;
}

.object-card:hover::before {
    left: 100%;
}

.object-card:hover {
    border-color: var(--gold);
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.object-card:active {
    transform: translateY(-5px) scale(0.98);
}

.object-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 15px;
    transition: var(--transition);
}

.object-card:hover .object-card-title {
    color: var(--gold);
}

/* ========================================
   OBJECT PAGE STYLES
   ======================================== */

.back-button {
    padding: 20px;
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    display: inline-block;
    padding: 12px 24px;
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-back:hover {
    background: #1565C0;
    transform: translateX(-5px);
    box-shadow: var(--shadow-hover);
}

.object-page {
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.object-title {
    font-size: 2.5rem;
    color: var(--blue);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--gold);
    animation: fadeIn 0.8s ease-in;
}

.object-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--black);
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    animation: fadeIn 1s ease-in 0.2s both;
}

.object-description p {
    margin-bottom: 15px;
}

/* ========================================
   IMAGE GALLERY
   ======================================== */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    animation: fadeIn 1s ease-in 0.4s both;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--gray);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ========================================
   3D MODEL VIEWER
   ======================================== */

.model-viewer-container {
    margin: 60px 0;
    animation: fadeIn 1s ease-in 0.6s both;
}

.model-controls {
    margin-bottom: 20px;
    text-align: center;
}

.btn-fullscreen {
    padding: 12px 24px;
    background: var(--gold);
    color: var(--black);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-fullscreen:hover {
    background: #c9a52f;
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.model-viewer {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}

.model-viewer canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Fullscreen styles */
.model-viewer.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
}

/* ========================================
   TASK SECTION
   ======================================== */

.task-section {
    margin: 60px 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid var(--blue);
    animation: fadeIn 1s ease-in 0.8s both;
}

.task-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--black);
}

.task-content p {
    margin-bottom: 15px;
}

.task-image-container {
    margin: 30px 0;
    text-align: center;
}

.task-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.task-answer {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.answer-input {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--gray);
    border-radius: 10px;
    transition: var(--transition);
    font-family: inherit;
}

.answer-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.1);
}

.answer-input.correct {
    border-color: #27AE60;
    background: #d5f4e6;
}

.answer-input.incorrect {
    border-color: #E74C3C;
    background: #fadbd8;
}

.btn-check {
    padding: 15px 30px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.btn-check:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-check:active {
    transform: translateY(0);
}

.answer-feedback {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
}

.answer-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.answer-feedback.correct {
    background: #d5f4e6;
    color: #27AE60;
    border: 2px solid #27AE60;
}

.answer-feedback.incorrect {
    background: #fadbd8;
    color: #E74C3C;
    border: 2px solid #E74C3C;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--blue);
    color: var(--white);
    text-align: center;
    padding: 30px 20px;
    margin-top: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Stagger animation for grid items */
.objects-grid .object-card:nth-child(1) { animation-delay: 0.1s; }
.objects-grid .object-card:nth-child(2) { animation-delay: 0.2s; }
.objects-grid .object-card:nth-child(3) { animation-delay: 0.3s; }
.objects-grid .object-card:nth-child(4) { animation-delay: 0.4s; }
.objects-grid .object-card:nth-child(5) { animation-delay: 0.5s; }
.objects-grid .object-card:nth-child(6) { animation-delay: 0.6s; }
.objects-grid .object-card:nth-child(7) { animation-delay: 0.7s; }
.objects-grid .object-card:nth-child(8) { animation-delay: 0.8s; }
.objects-grid .object-card:nth-child(9) { animation-delay: 0.9s; }
.objects-grid .object-card:nth-child(10) { animation-delay: 1.0s; }
.objects-grid .object-card:nth-child(11) { animation-delay: 1.1s; }
.objects-grid .object-card:nth-child(12) { animation-delay: 1.2s; }
.objects-grid .object-card:nth-child(13) { animation-delay: 1.3s; }
.objects-grid .object-card:nth-child(14) { animation-delay: 1.4s; }
.objects-grid .object-card:nth-child(15) { animation-delay: 1.5s; }
.objects-grid .object-card:nth-child(16) { animation-delay: 1.6s; }
.objects-grid .object-card:nth-child(17) { animation-delay: 1.7s; }
.objects-grid .object-card:nth-child(18) { animation-delay: 1.8s; }
.objects-grid .object-card:nth-child(19) { animation-delay: 1.9s; }
.objects-grid .object-card:nth-child(20) { animation-delay: 2s; }
.objects-grid .object-card:nth-child(21) { animation-delay: 2.1s; }
.objects-grid .object-card:nth-child(22) { animation-delay: 2.2s; }
.objects-grid .object-card:nth-child(23) { animation-delay: 2.3s; }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-intro {
        font-size: 0.9rem;
    }

    .objects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-title {
        font-size: 2rem;
    }

    .object-title {
        font-size: 2rem;
    }

    .task-answer {
        flex-direction: column;
    }

    .answer-input {
        width: 100%;
    }

    .model-viewer {
        height: 400px;
    }

    .lang-switcher {
        top: 10px;
        right: 10px;
        padding: 8px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 50px 15px 30px;
    }

    .objects-section {
        padding: 40px 15px;
    }

    .object-page {
        padding: 20px 15px;
    }

    .task-section {
        padding: 25px 20px;
    }
}
