:root {
    /* Основные цвета темы */
    --primary-green: #10b981;
    --primary-dark: #047857;
    --primary-light: #a7f3d0;
    --gradient-start: #03281c;
    --gradient-end: #064e3b;
    
    /* Цвета для текста */
    --text-light: #f8fafc;
    --text-dark: #1e293b;
    --text-on-light: #3c3c3c;
    --text-muted: #6b6b6b;
    
    /* Новые цвета для элементов (кремовые/бежевые тона) */
    --card-bg: #f8f5f0;
    --card-light: #fffef9;
    --card-border: #e8e4d9;
    --input-bg: #fffef9;
    
    /* Остальные переменные */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --gradient-1: #03281c;
    --gradient-2: #064e3b;
    --gradient-3: #047857;
    --gradient-4: #02221a;
    --wave-speed: 20s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, 
        #021a14 0%, 
        #03281c 25%, 
        #064e3b 50%, 
        #03281c 75%, 
        #021a14 100%);
    background-size: 1000% 1000%;
    animation: waveAnimation var(--wave-speed) ease-in-out infinite;
    position: relative;
    overflow-x: hidden;
    color: var(--text-light);
    min-height: 100vh;
}

.hero h1,
.hero p,
.nav-brand,
.nav-link,
.footer {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Основные контейнеры с кремовым фоном */
.audio-library,
.controls,
.auth-card,
.admin-container,
.instructions {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    color: var(--text-on-light);
}

@keyframes waveAnimation {
    0%, 100% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 100%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 0%;
    }
}

/* Волны SVG анимация */
.waves {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.3;
    pointer-events: none;
}

.wave {
    animation: waveMove 25s linear infinite;
    fill: rgba(255, 255, 255, 0.1);
}

.wave:nth-child(2) {
    animation-duration: 20s;
    animation-delay: -5s;
    opacity: 0.5;
}

.wave:nth-child(3) {
    animation-duration: 15s;
    animation-delay: -2s;
    opacity: 0.7;
}

@keyframes waveMove {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

body.gradient-disabled .waves {
    display: none;
}

body.gradient-disabled {
    background: linear-gradient(135deg, #1a5c47, #2d9c7c);
    animation: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Когда градиент отключен - статичный зеленый */
body.gradient-disabled {
    background: linear-gradient(135deg, #1a5c47, #2d9c7c);
    animation: none;
}

/* Параллакс эффект для контента */
.main-content {
    position: relative;
    z-index: 2;
}

/* Пульсирующие элементы */
.pulse-element {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: pulse 3s infinite;
    z-index: 1;
}

.pulse-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.pulse-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.gradient-disabled {
    background: linear-gradient(135deg, #1e293b, #334155);
    animation: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    background: rgba(4, 40, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    margin: 1rem 0;
    padding: 1rem 1.5rem;
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-green));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #065f46, #0da573);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Волны */
.waves {
    opacity: 0.2;
}

.wave {
    fill: rgba(255, 255, 255, 0.05);
}

/* Когда градиент отключен */
body.gradient-disabled {
    background: linear-gradient(135deg, #03281c, #064e3b);
    animation: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.nav-brand i {
    color: var(--primary-light);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Основной контент */
.main-content {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Аудио карточки */
.audio-library {
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.audio-library h2 {
    margin-bottom: 1.5rem;
    color: var(--text-on-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid var(--primary-green);
    background: transparent;
    color: var(--primary-green);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn.active,
.category-btn:hover {
    background: var(--primary-green);
    color: white;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.audio-card {
    background: var(--card-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--card-border);
    color: var(--text-on-light);
}

.audio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.audio-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audio-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.audio-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-on-light);
}

.audio-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.audio-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.audio-meta i {
    margin-right: 5px;
}

.audio-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-play {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    color: white;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* Плеер */
.controls {
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(232, 228, 217, 0.3);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    flex: 1;
    min-width: 200px;
}

.now-playing i {
    color: var(--primary-green);
}

audio {
    flex: 2;
    min-width: 300px;
}

/* Аутентификация */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-on-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    background: var(--input-bg);
    border: 2px solid var(--card-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    color: var(--text-on-light);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
    background: #ffffff;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.remember-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Админ-панель */
.admin-container {
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.admin-header {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-on-light);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.upload-section,
.files-section {
    background: var(--card-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
}

.files-list {
    max-height: 500px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: rgba(232, 228, 217, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
}

.file-details h4 {
    margin-bottom: 0.25rem;
    color: var(--text-on-light);
}

.file-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.category-badge {
    background: rgba(167, 243, 208, 0.3);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Инструкции */
.instructions {
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.instructions h2 {
    margin-bottom: 2rem;
    color: var(--text-on-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.instruction-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

.instruction-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.instruction-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-on-light);
}

.instruction-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Футер */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-light);
    margin-top: 2rem;
}

.gradient-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
}

/* Переключатель */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-green);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    color: #d6d2c7;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-on-light);
}

/* Флеш-сообщения */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.flash-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
    color: white;
    box-shadow: var(--shadow);
}

.flash-message.success {
    background: var(--primary-green);
}

.flash-message.error {
    background: #ef4444;
}

.flash-message.info {
    background: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .audio-grid {
        grid-template-columns: 1fr;
    }
    
    .player-controls {
        flex-direction: column;
    }
    
    audio {
        width: 100%;
        min-width: unset;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .category-filter {
        justify-content: center;
    }
    
    .file-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .file-info {
        flex-direction: column;
        text-align: center;
    }
}