/**
 * Base Styles
 * Global resets and foundational styles
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

/* Desktop: no bottom nav padding */
@media (min-width: 1024px) {
    .app {
        padding-bottom: 0;
    }
}

/* Body lock when player is open */
body.player-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Common Button Styles */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.96);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    flex: 1;
    max-width: 200px;
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(4px);
}

.btn-danger {
    background: var(--error);
    color: var(--text-primary);
    padding: 0 14px;
    height: 36px;
    font-size: 0.8rem;
}

/* Icon Button */
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

/* Sections */
.section {
    padding: 20px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .section-header {
        padding: 0 24px;
        margin-bottom: 16px;
    }
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 0.03em;
}

/* Progress Bar */
.progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Spinner / Loader */
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* App Loader */
.app-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s;
}

.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loader .logo {
    font-size: 2rem;
    margin-bottom: 20px;
}
