/* UI Consistency Improvements for Aion Visualization */

/* Consistent Button Styles */
button,
.button,
.nav-link,
.cta-button {
    font-family: Georgia, serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

button:focus,
.button:focus,
.nav-link:focus,
.cta-button:focus {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

/* Smooth hover transitions for interactive elements */
a,
button,
input,
.clickable {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Consistent input styling */
input[type="text"],
input[type="number"],
input[type="range"] {
    font-family: Georgia, serif;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    color: #D4AF37;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
    outline: none;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #333;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #D4AF37;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Consistent animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

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

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

/* Consistent scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
    transition: background 0.3s ease;
}

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

/* Consistent selection colors */
::selection {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* Consistent spacing */
.section {
    animation: fadeIn 0.6s ease-out;
}

/* Enhanced visualization containers */
.viz-container,
.viz-section {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.viz-container::before,
.viz-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(212, 175, 55, 0.05) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.viz-container:hover::before,
.viz-section:hover::before {
    opacity: 1;
}

/* Consistent tooltip styling */
.tooltip {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #D4AF37;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease-out;
}

/* Enhanced focus styles for accessibility */
*:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
.chapter-item,
.nav-link,
.feature-card,
.viz-section {
    transform: translateZ(0); /* Enable hardware acceleration */
    backface-visibility: hidden; /* Prevent flickering */
}

/* Consistent glow effects */
.glow {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.glow-text {
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* Responsive improvements */
@media (max-width: 768px) {
    /* Touch-friendly sizing */
    button,
    .button,
    .nav-link,
    .cta-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing on mobile */
    .section {
        padding: 2rem 1rem;
    }
}

/* Print styles for better readability */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .nav,
    .nav-toggle,
    .aion-nav,
    .chapter-nav {
        display: none;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}