/* Global Styles for Enhanced UI */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading animations */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

/* Enhanced loading screen styles */
.loading-logo {
    animation: float 3s ease-in-out infinite;
}

.loading-logo::before {
    animation: pulse 2s ease-in-out infinite;
}

/* Button hover effects */
.menu-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.menu-button:active {
    transform: translateY(0);
}

.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.menu-button:hover::before {
    left: 100%;
}

/* Enhanced controls panel */
#controls {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: opacity 0.3s ease;
}

#controls:hover {
    opacity: 0.9;
}

/* Mobile responsive enhancements */
@media (max-width: 768px) {
    #controls {
        font-size: 11px;
        padding: 10px;
        max-width: 200px;
    }
    
    .loading-text {
        font-size: 16px;
    }
    
    .progress-container {
        width: 200px;
    }
    
    .pause-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .menu-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #controls {
        top: 10px;
        left: 10px;
        font-size: 10px;
        padding: 8px;
        max-width: 180px;
    }
    
    #viewToggle, #dayNightToggle {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #dayNightToggle {
        top: 55px;
    }
    
    .loading-logo {
        width: 100px;
        height: 100px;
    }
    
    .loading-text {
        font-size: 14px;
    }
    
    .progress-container {
        width: 150px;
    }
}

/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

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

/* Print styles */
@media print {
    #gameContainer, #loadingScreen {
        display: none !important;
    }
    
    body::after {
        content: "Doraemon 3D World - Interactive Web Experience\APlease visit the website to play the game.";
        white-space: pre-line;
        display: block;
        text-align: center;
        margin-top: 50px;
        font-size: 18px;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
canvas:focus {
    outline: 2px solid #4ecdc4;
    outline-offset: 2px;
}

/* Custom cursor states */
.game-cursor-grab {
    cursor: grab;
}

.game-cursor-grabbing {
    cursor: grabbing;
}

.game-cursor-pointer {
    cursor: pointer;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 1001;
    max-width: 300px;
    transform: translateX(350px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #4ecdc4;
}

.notification.warning {
    border-left: 4px solid #ffa500;
}

.notification.error {
    border-left: 4px solid #ff6b6b;
}

/* Loading states */
.loading-state {
    pointer-events: none;
    opacity: 0.6;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4ecdc4;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Performance indicator */
#performance-indicator {
    position: absolute;
    top: 170px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 100;
}

.performance-good { color: #4ecdc4; }
.performance-medium { color: #ffa500; }
.performance-poor { color: #ff6b6b; }
