:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4895ef;
    --danger: #f72585;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --background: linear-gradient(135deg, #ffffff, #e0e0e0);
    --card-bg: rgba(255, 255, 255, 0.85);
    --text: #212529;
    --border: rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --blur: 10px;
    --btn-bg: #4361ee;
    --btn-hover-bg: #364fc7;
    --btn-text: #ffffff;
}

[data-theme="dark"] {
    --primary: #4895ef;
    --secondary: #3f37c9;
    --accent: #4361ee;
    --danger: #f72585;
    --success: #4cc9f0;
    --light: #343a40;
    --dark: #f8f9fa;
    --background: #121212;
    --card-bg: rgba(30, 30, 30, 0.9);
    --text: #f8f9fa;
    --border: rgba(255, 255, 255, 0.1);
    --blur: 20px;
    --btn-bg: #4895ef;
    --btn-hover-bg: #3a87e3;
    --btn-text: #ffffff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    transition: var(--transition);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: var(--background);
    backdrop-filter: blur(var(--blur));
}

/* Градиентный размытый фон */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: linear-gradient(
        135deg,
        rgba(255, 99, 71, 0.2) 0%,
        rgba(255, 159, 64, 0.2) 50%,
        rgba(247, 37, 133, 0.2) 100%
    );
    background-size: 200% 200%;
    animation: gradientMove 10s ease infinite;
    z-index: -2;
    filter: blur(80px);
    opacity: 0.8;
    transition: var(--transition);
}

[data-theme="dark"] body::before {
    background: linear-gradient(
        135deg,
        rgba(67, 97, 238, 0.2) 0%,
        rgba(30, 30, 30, 0.5) 50%,
        rgba(247, 37, 133, 0.1) 100%
    );
    filter: blur(100px);
    opacity: 0.6;
}

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

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    animation: fadeIn 0.6s ease-out;
}

h1, h2, h3 {
    color: var(--text);
    margin-bottom: 20px;
}

.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: var(--btn-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: var(--transition);
    border: none;
}

.theme-switcher:hover {
    background: var(--btn-hover-bg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.theme-switcher i {
    font-size: 20px;
    transition: var(--transition);
}

.chart-container {
    height: 300px;
    margin-top: 20px;
    position: relative;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 15px;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
}

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

.chart-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.chart-toggle {
    display: flex;
    gap: 8px;
}

.chart-toggle button {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary);
}

.chart-toggle button:hover {
    background: rgba(67, 97, 238, 0.2);
}

.chart-toggle button.active {
    background: var(--primary);
    color: white;
}

.selection-controls {
    margin: 15px 0;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    display: flex;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    animation: fadeIn 0.8s ease-out;
    animation-fill-mode: both;
}

#record-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    font-weight: 600;
    padding: 12px 24px;
    transition: var(--transition);
}

#record-btn.recording {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.3);
}

.current-file {
    margin: 15px 0;
    padding: 12px;
    background: rgba(67, 97, 238, 0.05);
    border-radius: 8px;
    font-weight: 500;
    border-left: 4px solid var(--primary);
}

.time-controls {
    margin: 15px 0;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    animation: fadeIn 0.8s ease-out;
    animation-fill-mode: both;
    animation-delay: 0.2s;
}

.upload-section {
    margin-top: 25px;
    padding: 20px;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    transform: translateY(0);
    border: none;
    background: var(--btn-bg);
    color: var(--btn-text);
}

.btn:hover {
    background: var(--btn-hover-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: var(--btn-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: var(--transition);
    border: none;
}

.floating-button:hover {
    background: var(--btn-hover-bg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Плавные переходы между страницами */
html {
    scroll-behavior: smooth;
    transition: background 1.5s ease;
}

/* Анимация перехода между страницами */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}
.page-transition::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* кнопки */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::after {
    opacity: 1;
}

/* Специальные стили для разных типов кнопок */
.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Улучшенный фон с анимацией */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: linear-gradient(
        135deg,
        rgba(67, 97, 238, 0.2) 0%,
        rgba(72, 149, 239, 0.2) 25%,
        rgba(76, 201, 240, 0.2) 50%,
        rgba(247, 37, 133, 0.2) 75%,
        rgba(67, 97, 238, 0.2) 100%
    );
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite, colorShift 30s ease infinite alternate;
    z-index: -2;
    filter: blur(80px);
    opacity: 0.8;
    transition: all 1.5s ease;
}

[data-theme="dark"] body::before {
    background: linear-gradient(
        135deg,
        rgba(67, 97, 238, 0.3) 0%,
        rgba(63, 55, 201, 0.3) 25%,
        rgba(72, 149, 239, 0.3) 50%,
        rgba(247, 37, 133, 0.3) 75%,
        rgba(67, 97, 238, 0.3) 100%
    );
    filter: blur(100px);
    opacity: 0.6;
}

/* Новая анимация смены цветов */
@keyframes colorShift {
    0% {
        filter: hue-rotate(0deg) blur(80px);
    }
    50% {
        filter: hue-rotate(45deg) blur(90px);
    }
    100% {
        filter: hue-rotate(-45deg) blur(80px);
    }
}

/* Анимация появления элементов */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

/* Плавное появление таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    animation: fadeIn 0.8s ease-out;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

table tr:hover td {
    background: rgba(67, 97, 238, 0.05);
}

/* Анимация загрузки */
.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(67, 97, 238, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Плавный скролл для контейнеров */
.scroll-container {
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--light);
}

.scroll-container::-webkit-scrollbar {
    width: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}
/* Стили для кнопок выделения */
.selection-controls {
    position: relative;
    z-index: 10;
}

.selection-controls .btn {
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

#startSelection {
    background: var(--primary);
    color: white;
}

#clearSelection {
    background: var(--danger);
    color: white;
}

/* Анимация активного выделения */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(75, 192, 192, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(75, 192, 192, 0); }
    100% { box-shadow: 0 0 0 0 rgba(75, 192, 192, 0); }
}

.active-selection {
    animation: pulse 1.5s infinite;
}

/* СНИЗУ ИДУТ МОИ ИЗМЕНЕНИЯ*/
/*.footer {
    margin-top: 40px;
    padding: 2px 0;
    text-align: center;
    border-top: 1px solid #0627fe80;
    color: #ff0000;
    font-size: 0.9em;
    background-color: #00fc1554;

}*/
