/* ======================================
   VČELAŘSKÁ STEZKA - CLEAN CSS
   Bez !important deklarací
   ====================================== */

/* ===== ZÁKLADNÍ NASTAVENÍ ===== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* ===== iOS PERMISSION LOADING SCREENS ===== */
#ios-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    text-align: center;
    font-family: Arial, sans-serif;
}

#ios-loading-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 300px;
    line-height: 1.5;
}

.ios-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: iosSpinner 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes iosSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#ios-error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    text-align: center;
    padding: 2rem;
    font-family: Arial, sans-serif;
}

#ios-error-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 350px;
    line-height: 1.6;
}

.ios-retry-button, .ios-back-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin: 0.5rem;
    transition: all 0.3s ease;
}

.ios-retry-button:hover, .ios-back-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

a-scene.ios-hidden {
    display: none;
}

/* ===== ZPĚT TLAČÍTKO ===== */
.back-button {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    padding: 10px 15px;
    background: rgba(255, 193, 7, 0.9);
    color: black;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    min-width: 120px;
    min-height: 44px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    opacity: 0.8;
    pointer-events: auto;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 193, 7, 1);
    transform: scale(1.05);
}

/* ===== NAVIGAČNÍ MENU ===== */
.navigation {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    opacity: 0.8;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.nav-toggle {
    background: rgba(255, 193, 7, 0.9);
    color: black;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    min-width: 120px;
    min-height: 44px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    opacity: inherit;
    pointer-events: auto;
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-toggle:hover {
    background: rgba(255, 193, 7, 1);
    transform: scale(1.05);
}

.nav-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: rgba(255, 193, 7, 0.95);
    border-radius: 8px;
    padding: 10px;
    min-width: 200px;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: auto;
    opacity: 1;
}

.nav-content.open {
    display: block;
    animation: navSlideDown 0.3s ease-out;
}

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

/* ===== AUDIO OVLÁDÁNÍ ===== */
.audio-info {
    position: fixed;
    top: 60px;
    left: 10px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 12px;
    border-radius: 50%;
    font-size: 20px;
    z-index: 1000;
    cursor: pointer;
    user-select: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(40, 167, 69, 1);
    opacity: 1;
    box-sizing: border-box;
    pointer-events: auto;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
}

.audio-info:hover {
    background: rgba(40, 167, 69, 1);
    transform: scale(1.05);
}

.audio-info:active {
    background: rgba(34, 142, 58, 1);
    transform: scale(0.95);
}

/* ===== AUDIO BUTTON PRIORITY FIX ===== */
#audioInfo,
.audio-info {
    opacity: 1;
    pointer-events: auto;
    z-index: 1002; /* Vyšší než navigation */
    cursor: pointer;
}

/* Zajistit že kvíz nezablokuje audio button */
.quiz-active #audioInfo,
.quiz-active .audio-info {
    opacity: 0.8; /* Místo 0.3 */
    pointer-events: auto; /* Force auto */
    z-index: 12002; /* Vyšší než kvíz */
}

/* Audio button states */
#audioInfo.playing {
    background: rgba(76, 175, 80, 0.9);
    border-color: rgba(76, 175, 80, 1);
    color: white;
}

#audioInfo.paused {
    background: rgba(255, 193, 7, 0.9);
    border-color: rgba(255, 193, 7, 1);
    color: black;
}

/* ===== UI ELEMENTY ===== */
.ui-element {
    pointer-events: auto;
}

.distance-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 193, 7, 0.9);
    color: black;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.gamification-status {
    display: none;
}

.debug-button {
    display: none;
}

/* ===== NAVIGAČNÍ SEZNAMY ===== */
.target-item {
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    cursor: pointer;
    border-left: 3px solid #ff6b35;
    transition: all 0.2s ease;
}

.target-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(3px);
}

.target-item.selected {
    background: rgba(255, 215, 0, 0.9);
    border-left-color: #FFD700;
    font-weight: bold;
}

.target-item.closest {
    border-left-color: #28a745;
}

#clearSelection {
    display: none;
    background: tomato;
    color: white;
    padding: 5px;
    text-align: center;
    margin-top: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#clearSelection:hover {
    background: #e74c3c;
    transform: scale(1.02);
}

/* ===== ROTACE NÁPOVĚDA ===== */
.rotation-hint {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    display: none;
    text-align: center;
    transition: all 0.3s ease;
}

/* ===== VČELÍ KVÍZOVÝ SYSTÉM ===== */
.bee-quiz {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 248, 220, 0.98);
    color: #333;
    padding: 20px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: normal;
    z-index: 12000;
    display: none;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border: 3px solid #FFD700;
    text-align: center;
    animation: quizAppear 0.5s ease-out;
}

.quiz-question {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #8B4513;
}

.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.quiz-answer {
    background: rgba(255, 193, 7, 0.8);
    color: black;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #FFA500;
    font-weight: bold;
    transition: all 0.2s ease;
    position: relative;
    z-index: 12001;
    pointer-events: auto;
}

.quiz-answer:hover {
    background: rgba(255, 193, 7, 1);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quiz-answer.correct {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border-color: #4CAF50;
    animation: correctAnswer 0.5s ease-in-out;
}

.quiz-answer.incorrect {
    background: rgba(244, 67, 54, 0.7);
    color: white;
    border-color: #F44336;
    animation: incorrectAnswer 0.5s ease-in-out;
}

@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectAnswer {
    0% { transform: scale(1); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.quiz-explanation {
    background: rgba(173, 216, 230, 0.9);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-style: italic;
    border-left: 4px solid #4682B4;
    display: none;
    animation: explanationAppear 0.3s ease-out;
}

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

.quiz-close {
    background: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    border: none;
    font-weight: bold;
    transition: all 0.2s ease;
    position: relative;
    z-index: 12001;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quiz-close:hover {
    background: rgba(108, 117, 125, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.quiz-close:active {
    transform: scale(0.95);
}

.quiz-progress {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

/* ===== CLEAN STATE MANAGEMENT ===== */
/* Normální stav - všechno viditelné */
.navigation,
.back-button {
    opacity: 0.8;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.audio-info {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* Kvíz aktivní - lehké ztlumení */
.quiz-active .navigation,
.quiz-active .back-button {
    opacity: 0.5;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.quiz-active .audio-info {
    opacity: 0.8; /* Místo 0.3 */
    pointer-events: auto; /* Force auto */
    z-index: 12002; /* Vyšší než kvíz */
}

.quiz-active a-scene {
    pointer-events: none;
}

/* Tutorial má nejvyšší prioritu */
#tutorialOverlay {
    z-index: 15000;
}

/* ===== UNLOCK NOTIFIKACE ===== */
.unlock-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    width: 350px;
    background: linear-gradient(135deg, #ff6b35, #FFA500);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    font-family: Arial, sans-serif;
}

.unlock-notification.show {
    right: 20px;
}

.unlock-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
}

.unlock-icon {
    font-size: 32px;
    margin-right: 15px;
    animation: unlockPulse 1s ease-in-out;
}

.unlock-text strong {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.unlock-text span {
    font-size: 14px;
    opacity: 0.9;
}

@keyframes unlockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== ANIMACE ===== */
@keyframes quizAppear {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1); 
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 480px) {
    .bee-quiz {
        top: 10%;
        width: 95%;
        padding: 15px;
    }
    
    .quiz-question {
        font-size: 16px;
    }
    
    .quiz-answer {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .distance-info {
        bottom: 10px;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .navigation {
        top: 5px;
        right: 5px;
    }
    
    .back-button {
        top: 5px;
        left: 5px;
        padding: 8px 12px;
        font-size: 14px;
    }
}

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

@media (display-mode: standalone) {
    a-scene.ios-hidden {
        display: block;
        opacity: 0.01;
        pointer-events: none;
    }
}

@media (prefers-contrast: high) {
    .bee-quiz {
        border-width: 4px;
        box-shadow: 0 0 0 2px #000;
    }
    
    .quiz-answer {
        border-width: 3px;
    }
    
    .quiz-close {
        border: 2px solid #fff;
    }
}

/* ===== GLOBÁLNÍ BOX-SIZING ===== */
* {
    box-sizing: border-box;
}

/* ===== COIN COLLECT BUTTON - HIGHEST PRIORITY ===== */
.collect-coin-button {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #333 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-weight: bold !important;
    font-size: 12px !important;
    cursor: pointer !important;
    z-index: 15000 !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.8) !important; /* Zvýšená viditelnost */
    animation: coinButtonPulse 2s infinite !important;
    user-select: none !important;
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important; /* VŽDY PLNĚ VIDITELNÉ */
    visibility: visible !important;
    /* ODSTRANĚNÍ VŠECH MOŽNÝCH PRŮHLEDNÝCH POZADÍ */
    outline: none !important;
    box-sizing: content-box !important;
    background-clip: padding-box !important;
    /* FORCE ŽLUTÉ POZADÍ */
    background-color: #FFD700 !important;
    border: 2px solid #FFA500 !important;
}

.collect-coin-button img {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)) !important;
    flex-shrink: 0 !important;
    opacity: 1 !important; /* FORCE PLNÁ VIDITELNOST IKONY */
}

.collect-coin-button:hover {
    background: linear-gradient(135deg, #FFED4A, #FFD700) !important;
    background-color: #FFED4A !important; /* BACKUP ŽLUTÁ */
    transform: scale(1.03) !important;
    z-index: 15001 !important;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.9) !important;
    opacity: 1 !important; /* VŽDY PLNĚ VIDITELNÉ I PŘI HOVER */
}

.collect-coin-button:active {
    background: linear-gradient(135deg, #FFA500, #FF8C00) !important;
    background-color: #FFA500 !important; /* BACKUP ORANŽOVÁ */
    transform: scale(0.97) !important;
    z-index: 15001 !important;
    opacity: 1 !important; /* VŽDY PLNĚ VIDITELNÉ I PŘI CLICK */
}

/* FORCE COIN BUTTON VISIBILITY I BĚHEM KVÍZU A TUTORIALU */
.quiz-active .collect-coin-button,
.tutorial-active .collect-coin-button {
    opacity: 1 !important; /* NEJSILNĚJŠÍ FORCE */
    pointer-events: auto !important;
    z-index: 15000 !important;
    display: flex !important;
    visibility: visible !important;
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    background-color: #FFD700 !important; /* BACKUP */
}

@keyframes coinButtonPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.8);
        opacity: 1; /* FORCE OPACITY V ANIMACI */
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 6px 20px rgba(255, 215, 0, 1.0);
        opacity: 1; /* FORCE OPACITY V ANIMACI */
    }
}

/* COIN NOTIFICATION ANIMATION */
@keyframes coinNotificationAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* CHEST COLLECT BUTTON */
.collect-chest-button {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    background: linear-gradient(135deg, #8B4513, #CD853F) !important;
    color: #FFD700 !important;
    border: 2px solid #CD853F !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-weight: bold !important;
    font-size: 12px !important;
    cursor: pointer !important;
    z-index: 15000 !important;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.8) !important;
    user-select: none !important;
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: chestButtonPulse 2s infinite !important;
}

.collect-chest-button:hover {
    background: linear-gradient(135deg, #A0522D, #DEB887) !important;
    transform: scale(1.03) !important;
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.9) !important;
}

@keyframes chestButtonPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(139, 69, 19, 0.8);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 6px 20px rgba(139, 69, 19, 1.0);
    }
}

/* VYČISTIT VŠECHNY MOŽNÉ INTERFERUJÍCÍ STYLY */
.collect-coin-button,
.collect-coin-button:before,
.collect-coin-button:after {
    background-image: none !important;
    border-image: none !important;
    opacity: 1 !important; /* FORCE VŠUDE */
}

/* OVERRIDE JAKÉKOLIV MOŽNÉ PRŮHLEDNOSTI */
body .collect-coin-button,
html .collect-coin-button,
* .collect-coin-button {
    opacity: 1 !important;
    background-color: #FFD700 !important;
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
}
