/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0e27 0%, #1a1a2e 100%);
    color: #ffffff;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-content .snowflake {
    font-size: 4rem;
    animation: spin 2s linear infinite;
    margin-bottom: 1rem;
}

.loading-content h2 {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    width: 100%;
}

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

@keyframes loading {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.loading-credits {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.loading-credits a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.loading-credits a:hover {
    color: #ffd700;
}

/* ===== QUALITY TOGGLE BUTTON ===== */
#quality-toggle {
    position: fixed;
    bottom: 124px;
    left: 20px;
    z-index: 100;
    padding: 6px 12px;
    border-radius: 18px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

#quality-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

#quality-toggle.high-quality {
    border-color: rgba(76, 175, 80, 0.5);
}

#quality-toggle.low-quality {
    border-color: rgba(255, 152, 0, 0.5);
}

#quality-icon {
    font-size: 0.9rem;
}

#quality-label {
    font-weight: 500;
}

/* ===== CREDITS BUTTON & MODAL ===== */
#credits-button {
    position: fixed;
    bottom: 78px;
    left: 20px;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#credits-button:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    transform: scale(1.1);
}

#credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

#credits-modal.hidden {
    display: none;
}

.credits-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.credits-content h3 {
    color: #ffd700;
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
}

#close-credits {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

#close-credits:hover {
    color: #ff6b6b;
}

.credits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credit-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.credit-item a {
    color: #4ecdc4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.credit-item a:hover {
    color: #ffd700;
    text-decoration: underline;
}

.credit-item span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.credit-item .license {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: auto;
}

/* ===== CANVAS CONTAINER ===== */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== LOGO PANEL ===== */
#logo-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#logo-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

#logo-panel img {
    height: 40px;
    width: auto;
    display: block;
}

/* ===== CONFETTI CANVAS ===== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1001;
    pointer-events: none;
}

/* ===== SEARCH CONTAINER ===== */
#search-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    width: 300px;
    outline: none;
    transition: all 0.3s ease;
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#clear-search {
    background: rgba(255, 107, 107, 0.7);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

#clear-search:hover {
    opacity: 1;
    transform: scale(1.1);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px;
    color: #ffd700;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: none;
}

#search-results.visible {
    display: block;
}

/* ===== POSTCARD MODAL ===== */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

#modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#postcard-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 3px solid #dc143c;
}

#modal-overlay:not(.hidden) #postcard-modal {
    transform: scale(1);
}

#close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc143c;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(220, 20, 60, 0.4);
}

#close-modal:hover {
    background: #b01030;
    transform: rotate(90deg) scale(1.1);
}

.postcard-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffd700;
}

.postcard-header h2 {
    color: #228b22;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.employee-info {
    text-align: center;
    margin-bottom: 20px;
}

#employee-name {
    color: #1a1a2e;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

#employee-title {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

#employee-department {
    color: #777;
    font-size: 1rem;
    margin-bottom: 8px;
}

.team-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4ecdc4, #44a3d5);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
}

.message-divider {
    text-align: center;
    color: #4ecdc4;
    font-size: 1.2rem;
    margin: 20px 0;
}

.employee-message {
    background: rgba(255, 215, 0, 0.1);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #ffd700;
    margin-bottom: 20px;
}

#employee-message-text {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.6;
    font-style: italic;
}

.postcard-footer {
    text-align: center;
    font-size: 2rem;
    padding-top: 15px;
    border-top: 2px solid #ffd700;
}

.ornament-icon {
    margin: 0 10px;
    display: inline-block;
    animation: bounce 2s infinite;
}

.ornament-icon:nth-child(2) {
    animation-delay: 0.2s;
}

.ornament-icon:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ===== AUDIO CONTROLS ===== */
#audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#toggle-music,
#mute-music {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#toggle-music:hover,
#mute-music:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

#volume-slider {
    width: 80px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ===== INSTRUCTIONS ===== */
#instructions {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* Disable double-tap zoom on mobile */
    * {
        touch-action: manipulation;
    }

    #search-container {
        left: auto;
        right: 20px;
        transform: none;
        padding: 8px 12px;
        gap: 0;
    }

    #search-input {
        width: 140px;
        font-size: 0.8rem;
        padding: 6px 30px 6px 12px;
        border-radius: 16px;
    }

    /* Integrate clear button inside input on mobile */
    #clear-search {
        position: absolute;
        right: 18px;
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }

    #postcard-modal {
        padding: 25px;
        width: 95%;
    }

    .postcard-header h2 {
        font-size: 1.4rem;
    }

    #employee-name {
        font-size: 1.4rem;
    }

    #employee-message-text {
        font-size: 1rem;
    }

    #instructions {
        font-size: 0.75rem;
        padding: 8px 15px;
    }

    #audio-controls {
        bottom: 70px;
        padding: 8px 12px;
    }

    /* Hide volume slider and play button on mobile - only show mute */
    #volume-slider,
    #toggle-music {
        display: none !important;
    }

    /* Hide FPV button on mobile (no FPV mode on touch devices) */
    #fpv-button {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

/* Ornament hover effect (applied via JS) */
.ornament-hover {
    filter: brightness(1.3);
    cursor: pointer;
}
