:root {
    --primary-color: #2196F3;
    --secondary-color: #6c757d;
    --accent-color: #03A9F4;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-text: #fff;
    --background-gradient: linear-gradient(135deg, #e0f2f7 0%, #ffffff 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --premium-gradient: linear-gradient(135deg, #2193f3 0%, #135fb3 100%);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-bg: #fff;
    --header-bg: linear-gradient(135deg, #2196F3, #1976D2);
    --button-gradient: linear-gradient(135deg, #2196F3, #1976D2);
}

/* Темная тема */
body.dark-theme {
    --primary-color: #64B5F6;
    --secondary-color: #B0BEC5;
    --accent-color: #4FC3F7;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --light-text: #e0e0e0;
    --background-gradient: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    --card-bg: #1e1e1e;
    --header-bg: linear-gradient(135deg, #1a237e, #0d47a1);
    --button-gradient: linear-gradient(135deg, #64B5F6, #1976D2);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(33, 150, 243, 0.1), transparent 60%),
                radial-gradient(circle at bottom left, rgba(76, 175, 80, 0.1), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

header {
    background: linear-gradient(135deg, #2196F3, #1976D2, #0D47A1);
    background-size: 200% 200%;
    animation: gradientAnimation 15s ease infinite;
    color: var(--light-text);
    padding: 60px 20px;
    text-align: center;
    width: 100%;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="2"/></svg>');
    opacity: 0.1;
    z-index: 0;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    z-index: 0;
}

header h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    background: linear-gradient(to right, #ffffff, #e0f7fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

header p {
    font-size: 1.3em;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.library-section {
    width: 90%;
    max-width: 1000px;
    margin-bottom: 50px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    transition: var(--transition);
}

.library-section:hover {
    transform: translateY(-5px);
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.library-header h2 {
    font-size: 2em;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
}

.library-actions button, .library-actions a {
    padding: 12px 20px;
    margin-left: 15px;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-color);
    color: var(--light-text);
    text-decoration: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: var(--transition);
}

.library-actions button:hover, .library-actions a:hover {
    background-color: #0D47A1;
    transform: translateY(-2px);
}

.library-actions a {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.library-actions a:hover {
    background-color: #e0e0e0;
}

.audio-list {
    list-style: none;
    padding: 0;
}

.audio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
    border-radius: 8px;
}

.audio-item:hover {
    background-color: #f8f9fa;
}

.audio-item:last-child {
    border-bottom: none;
}

.audio-info {
    flex-grow: 1;
}

.audio-title {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.audio-description {
    display: block;
    color: var(--secondary-color);
    font-size: 0.95em;
}

.play-button {
    background-color: var(--accent-color);
    color: var(--light-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 20px;
    transition: var(--transition);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.play-button:hover {
    transform: scale(1.1);
    background-color: #0288D1;
}

.features {
    padding: 50px 20px;
    text-align: center;
    width: 90%;
    max-width: 1200px;
    margin-bottom: 50px;
}

.features h2 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.features h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.image-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.image-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(3, 169, 244, 0.1) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.image-item:hover::before {
    opacity: 1;
}

.image-item img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    width: auto;
    height: auto;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.image-item:hover img {
    transform: scale(1.03);
}

/* Шахматный порядок для 2 рядов по 3 картинки */
.image-grid .image-item:nth-child(2),
.image-grid .image-item:nth-child(5) {
    transform: translateY(20px);
}

.image-grid .image-item:nth-child(2):hover,
.image-grid .image-item:nth-child(5):hover {
    transform: translateY(10px);
}

.description {
    padding: 50px 30px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 80%;
    max-width: 1000px;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.description h2 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.description p {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-color);
    text-align: left;
    word-wrap: break-word;
}

.description a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.description a:hover {
    border-bottom-color: var(--primary-color);
    color: #0D47A1;
}

.download {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 50px;
    position: relative;
}

.download::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="none" stroke="rgba(33, 150, 243, 0.05)" stroke-width="2"/></svg>');
    opacity: 0.5;
    z-index: -1;
}

.download h2 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.download-button {
    display: inline-block;
    background: var(--button-gradient);
    color: var(--light-text);
    padding: 18px 50px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.3em;
    box-shadow: 0 10px 20px rgba(33, 150, 243, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.download-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(33, 150, 243, 0.4);
}

.download-button:hover::before {
    transform: translateY(0);
}

.download p {
    margin-top: 20px;
    font-size: 1em;
    color: var(--secondary-color);
}

footer {
    background: var(--header-bg);
    color: var(--light-text);
    text-align: center;
    padding: 30px;
    width: 100%;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

footer p {
    margin: 0;
}

footer p a {
    color: var(--light-text);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

footer p a:hover {
    color: #ddd;
    text-decoration: underline;
}

.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.enlarged-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: default;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 40px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
    text-align: left;
    animation: modalFadeIn 0.3s ease;
    color: var(--text-color);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.modal-content p {
    line-height: 1.8;
    color: var(--text-color);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.8em;
    color: var(--text-color);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: var(--transition);
}

.close-button:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

@media (max-width: 992px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-grid .image-item:nth-child(2),
    .image-grid .image-item:nth-child(5) {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5em;
    }
    
    .enlarged-image {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .modal-content {
        padding: 25px;
        max-width: 90%;
    }
    
    .description, .library-section {
        width: 90%;
        padding: 30px 20px;
    }
}

footer a {
    color: var(--light-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}

footer a:hover {
    border-bottom-color: var(--light-text);
    color: #ddd;
}

/* Стили для кнопки переключения темы */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 24px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Адаптация для темной темы */
body.dark-theme .image-item {
    background-color: var(--card-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
}

body.dark-theme .close-button {
    color: var(--text-color);
}

body.dark-theme .download-button {
    background: var(--button-gradient);
}

body.dark-theme a {
    color: var(--primary-color);
}

body.dark-theme .overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-theme .enlarged-image {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

body.dark-theme .description {
    background-color: var(--card-bg);
    color: var(--text-color);
}

body.dark-theme .image-grid {
    background-color: var(--card-bg);
}

/* Анимация для иконки переключения темы */
.theme-toggle-btn i {
    transition: transform 0.5s ease;
}

.theme-toggle-btn:hover i {
    transform: rotate(360deg);
}

/* Исправление для Firefox */
@-moz-document url-prefix() {
    body.dark-theme {
        background-color: #121212 !important;
        color: #e0e0e0 !important;
    }
    
    body.dark-theme .description,
    body.dark-theme .image-grid,
    body.dark-theme .modal-content {
        background-color: #1e1e1e !important;
        color: #e0e0e0 !important;
    }
    
    body.dark-theme .image-item {
        background-color: #1e1e1e !important;
    }
    
    body.dark-theme .theme-toggle-btn {
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
}

/* Темная тема */
body.dark-theme header {
    background: linear-gradient(135deg, #1a237e, #0d47a1, #01579b);
    background-size: 200% 200%;
    animation: gradientAnimation 15s ease infinite;
}

body.dark-theme header h1 {
    background: linear-gradient(to right, #ffffff, #b3e5fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
} 