/**
 * Base styles and CSS reset
 * Modern, minimal reset with accessibility considerations
 */

/* Box sizing reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margins and padding */
* {
    margin: 0;
    padding: 0;
}

/* Root element setup */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Body defaults */
body {
    min-height: 100vh;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
}

/* Improved media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Form elements inherit font */
input,
button,
textarea,
select {
    font: inherit;
}

/* Remove default button styles */
button {
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

/* Link defaults */
a {
    text-decoration: none;
    color: inherit;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-color, #3aefe4);
    outline-offset: 4px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Visually hidden utility class for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to main content link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color, #3aefe4);
    color: var(--primary-color, #000F29);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* Loading state */
.loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #000F29);
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(58, 239, 228, 0.2);
    border-top-color: var(--accent-color, #3aefe4);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Settings button */
.settings-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(58, 239, 228, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(58, 239, 228, 0.2);
    color: var(--accent-color, #3aefe4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 50;
}

.settings-toggle:hover {
    background: rgba(58, 239, 228, 0.2);
    transform: rotate(90deg);
}

.settings-toggle:active {
    transform: rotate(90deg) scale(0.95);
}

/* Settings panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--secondary-color, #00163b);
    border-left: 1px solid rgba(58, 239, 228, 0.2);
    padding: 2rem;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.settings-panel:not([hidden]) {
    transform: translateX(0);
}

.settings-content h2 {
    color: var(--accent-color, #3aefe4);
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-color, #ffffff);
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-color, #3aefe4);
}

.btn-close {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-color, #3aefe4);
    color: var(--primary-color, #000F29);
    border-radius: 4px;
    font-weight: 600;
    margin-top: 2rem;
    transition: opacity 0.2s ease;
}

.btn-close:hover {
    opacity: 0.9;
}

.btn-close:active {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .settings-panel {
        width: 100%;
    }
}
