* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray-800: #1e293b;
    --gray-600: #475569;
    --gray-400: #94a3b8;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --white: #ffffff;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --gradient-3: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --blur-bg: rgba(15, 23, 42, 0.7);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--dark);
    min-height: 100vh;
    color: var(--gray-800);
    overflow-x: hidden;
    position: relative;
}

/* Сложный геометрический узор на фоне */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Основные градиентные пятна */
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        /* Сетка из точек */
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        /* Диагональные линии */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 40px,
            rgba(99, 102, 241, 0.03) 40px,
            rgba(99, 102, 241, 0.03) 80px
        ),
        /* Горизонтальные волнистые линии */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 60px,
            rgba(236, 72, 153, 0.02) 60px,
            rgba(236, 72, 153, 0.02) 61px
        ),
        /* Вертикальные волнистые линии */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 60px,
            rgba(6, 182, 212, 0.02) 60px,
            rgba(6, 182, 212, 0.02) 61px
        );
    background-size: 
        100% 100%,
        100% 100%,
        100% 100%,
        40px 40px,
        100% 100%,
        100% 100%,
        100% 100%;
    pointer-events: none;
    z-index: -1;
    animation: slowDrift 20s ease-in-out infinite alternate;
}

@keyframes slowDrift {
    0% {
        background-position: 
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%;
    }
    100% {
        background-position: 
            5% 5%,
            -5% -5%,
            3% -3%,
            10px 10px,
            10px 10px,
            5px 5px,
            -5px -5px;
    }
}

/* Дополнительный декоративный узор - шевроны */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 100px,
        rgba(255, 255, 255, 0.02) 100px,
        rgba(255, 255, 255, 0.02) 101px,
        transparent 101px,
        transparent 200px
    );
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Glassmorphism */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 16px 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 20px;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    position: relative;
}

.logo::after {
    content: '';
    font-size: 1.2rem;
    margin-left: 5px;
    background: none;
    -webkit-text-fill-color: initial;
}

.nav {
    display: flex;
    gap: 8px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 40px;
}

.nav-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-radius: 32px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--gray-600);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn::before {
    font-size: 1.1rem;
}

.nav-btn[data-tab="timer"]::before { content: "⏱️"; }
.nav-btn[data-tab="music"]::before { content: "🎵"; }
.nav-btn[data-tab="stats"]::before { content: "📊"; }
.nav-btn[data-tab="about"]::before { content: "ℹ️"; }

.nav-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow);
}

/* Main Content - Glass Card */
.main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Декоративный уголок для main */
.main::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.main::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Task Section */
.task-section {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.task-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--white);
    font-weight: 500;
}

.task-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-600);
    border: 2px solid var(--gray-200);
    padding: 14px 24px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Tasks List */
.tasks-list {
    margin-bottom: 32px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.tasks-list::-webkit-scrollbar {
    width: 6px;
}

.tasks-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.tasks-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--gray-100);
    border-radius: 20px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.task-item:hover {
    background: var(--white);
    border-color: var(--gray-200);
    transform: translateX(4px);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    border: 2px solid var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--white);
    font-size: 14px;
    font-weight: bold;
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.task-text {
    flex: 1;
    font-weight: 500;
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--gray-400);
}

/* Timer Section */
.timer-section {
    text-align: center;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px dashed var(--gray-200);
}

.timer-display {
    font-size: 5rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time-settings {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-input-group label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-input {
    width: 90px;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.timer-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.session-status {
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 40px;
    display: inline-block;
    color: var(--primary);
}

/* Toggle Switch */
.focus-mode {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--gradient-1);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Music Player */
.music-player h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.music-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 32px;
}

.playlist {
    margin-bottom: 32px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.playlist::-webkit-scrollbar {
    width: 6px;
}

.playlist::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.playlist::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--gray-100);
    border-radius: 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.track:hover {
    background: var(--white);
    transform: translateX(5px);
    border-color: var(--gray-200);
}

.track.active {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

.track-info {
    text-align: left;
}

.track-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.track-artist {
    font-size: 0.8rem;
    opacity: 0.8;
}

.player-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 24px;
}

.player-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.play-pause {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
}

.now-playing {
    background: var(--gray-100);
    padding: 16px 20px;
    border-radius: 20px;
    text-align: center;
}

.current-track {
    font-weight: 700;
    margin-bottom: 4px;
}

.player-status {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Music Notes Animation */
.music-notes {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
    z-index: 1000;
}

.music-note {
    position: absolute;
    font-size: 24px;
    opacity: 0;
    animation: floatNote 3s ease-out forwards;
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.5));
}

@keyframes floatNote {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-120px) rotate(360deg);
        opacity: 0;
    }
}

/* Focus Mode Overlay */
.focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.focus-overlay.hidden {
    display: none;
}

.focus-message {
    background: var(--white);
    padding: 48px;
    border-radius: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.focus-message h2 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.focus-message p {
    margin-bottom: 16px;
    color: var(--gray-600);
}

#focusTimer {
    font-weight: 700;
    font-size: 1.4rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--gradient-1);
    padding: 28px 20px;
    border-radius: 28px;
    text-align: center;
    transition: all 0.3s ease;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Achievements */
.achievements {
    margin-top: 32px;
}

.achievements h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.achievement {
    background: var(--gray-100);
    padding: 20px;
    border-radius: 24px;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0.6;
    border: 2px solid transparent;
}

.achievement.unlocked {
    opacity: 1;
    background: var(--gradient-2);
    color: white;
    transform: scale(1.02);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.achievement-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.achievement-desc {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* About Page */
.about-content h2 {
    text-align: center;
    margin-bottom: 16px;
    font-size: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content > p {
    text-align: center;
    margin-bottom: 48px;
    color: var(--gray-600);
    font-size: 1.1rem;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.feature-item {
    background: var(--gray-100);
    padding: 28px 24px;
    border-radius: 28px;
    transition: all 0.3s ease;
    text-align: center;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: var(--white);
}

.feature-item h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.project-info {
    background: var(--gradient-3);
    color: white;
    padding: 36px;
    border-radius: 28px;
    text-align: center;
}

.project-info p:first-of-type {
    font-weight: 700;
    margin-bottom: 12px;
}

/* Notification */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    background: var(--dark);
    color: white;
    padding: 14px 24px;
    border-radius: 40px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.notification::before {
    content: "✨";
    font-size: 1.1rem;
}

.notification.hidden {
    opacity: 0;
    transform: translateX(100px);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
        top: 12px;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .main {
        padding: 24px;
    }
    
    .task-section {
        flex-direction: column;
    }
    
    .timer-display {
        font-size: 3rem;
    }
    
    .time-settings {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .timer-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .focus-message {
        margin: 20px;
        padding: 32px 20px;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-display {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
}