/* css/theme.css */
:root {
    /* Основные цвета */
    --primary-color: #3390ec;
    --secondary-color: var(--tg-theme-secondary-bg-color);
    --success-color: #34c759;
    --danger-color: #ff3b30;
    --text-primary: var(--tg-theme-text-color);
    --text-secondary: var(--tg-theme-hint-color);
    --bg-primary: var(--tg-theme-bg-color);
    --bg-secondary: var(--tg-theme-secondary-bg-color);
    --button-color: var(--tg-theme-button-color);
    --button-text-color: var(--tg-theme-button-text-color);
    
    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Скругления */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Анимации */
    --transition-base: all 0.3s ease;
    
    /* Дополнительные цвета */
    --divider-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.1);
}

/* Ограничение ширины для всех устройств */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary, #f5f5f5);
    color: var(--text-primary, #333);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    box-shadow: var(--shadow-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    text-align: center;
    flex-grow: 1;
}

.burger-menu {
    width: 24px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
}

.burger-menu span {
    display: block;
    height: 2px;
    background-color: white;
    transition: var(--transition-base);
}

/* Боковое меню */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: var(--bg-secondary, #f0f2f5);
    transition: left 0.3s ease;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    padding-top: 1rem;
}

.sidebar.active {
    left: 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary, #2a5885);
    text-decoration: none;
    transition: var(--transition-base);
}

.sidebar a.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Содержимое */
main {
    flex-grow: 1;
    padding: 1rem;
}

.minutes-container {
    background-color: var(--card-bg, #fff);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.minutes-container h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.minutes-display {
    background-color: var(--bg-secondary, #f0f4f8);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.minutes-label {
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--text-secondary);
}

.minutes-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.minutes-form input {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.minutes-form .buttons {
    display: flex;
    gap: 1rem;
}

.minutes-form button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-base);
}

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

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

.quick-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quick-add, .quick-subtract {
    background-color: var(--bg-secondary, #f0f4f8);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.quick-add h3, .quick-subtract h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.quick-add button, .quick-subtract button {
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.quick-add button {
    background-color: var(--success-color);
    color: white;
}

.quick-subtract button {
    background-color: var(--danger-color);
    color: white;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-secondary, #f0f2f5);
    color: var(--text-secondary);
    margin-top: auto;
}

/* Темная тема */
body.tg-theme-dark {
    --card-bg: #222222;
    --card-border: rgba(255, 255, 255, 0.1);
    --divider-color: rgba(255, 255, 255, 0.1);
}

.tg-theme-dark .sidebar {
    background-color: var(--bg-secondary, #222222);
}

.tg-theme-dark .sidebar a {
    color: var(--text-primary, #a5bcd5);
}

.tg-theme-dark .minutes-display {
    background-color: rgba(255, 255, 255, 0.05);
}

.tg-theme-dark .quick-add, .tg-theme-dark .quick-subtract {
    background-color: rgba(255, 255, 255, 0.05);
}

.tg-theme-dark input {
    background-color: rgba(255, 255, 255, 0.05);
}

.tg-theme-dark footer {
    background-color: var(--bg-secondary, #222222);
}
/* css/theme.css - добавьте эти стили к существующему файлу */

/* Плавающее бургер-меню */
.floating-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    cursor: pointer;
    transition: var(--transition-base);
}

.floating-menu:hover {
    transform: scale(1.1);
}

.burger-menu-icon {
    width: 20px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.burger-menu-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: var(--transition-base);
}

/* Обновленные стили для бокового меню */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: var(--bg-secondary, #f0f2f5);
    transition: left 0.3s ease;
    z-index: 500;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.sidebar-close {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 0;
    border-bottom: 1px solid var(--divider-color, rgba(0, 0, 0, 0.1));
}

.sidebar a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-primary, #2a5885);
    text-decoration: none;
    transition: var(--transition-base);
}

.sidebar a.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar a:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Затемнение фона при открытом меню */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 400;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Темная тема */
.tg-theme-dark .sidebar {
    background-color: var(--bg-secondary, #222222);
    border-right: 1px solid var(--divider-color, rgba(255, 255, 255, 0.1));
}

.tg-theme-dark .sidebar a {
    color: var(--text-primary, #a5bcd5);
}

.tg-theme-dark .sidebar li {
    border-bottom-color: var(--divider-color, rgba(255, 255, 255, 0.1));
}
/* Обновленная кнопка бургер-меню */
.header-burger {
    position: fixed;
    top: 15px;
    right: max(15px, calc(50% - 240px + 15px)); /* 15px от правого края контейнера */
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    z-index: 600; /* Выше, чем у sidebar */
    cursor: pointer;
    transition: var(--transition-base);
}

.header-burger:hover {
    transform: scale(1.1);
}

.burger-menu-icon {
    width: 18px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.burger-menu-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: var(--transition-base);
}

/* Анимация для бургер-иконки */
.header-burger.active .burger-menu-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.header-burger.active .burger-menu-icon span:nth-child(2) {
    opacity: 0;
}

.header-burger.active .burger-menu-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Обновленные стили для бокового меню */
.sidebar {
    position: fixed;
    top: 0;
    left: max(calc(50% - 520px), 0px); /* Не дальше 520px от центра */
    width: 280px;
    height: 100%;
    transform: translateX(-100%); /* Начальное положение - скрыто */
    background-color: var(--bg-secondary, #f0f2f5);
    transition: transform 0.3s ease;
    z-index: 500;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    padding-top: 20px;
}

.sidebar.active {
    transform: translateX(0); /* Видимое положение */
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 0.5rem;
}

.sidebar-header h3 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 8px 0;
}

.sidebar a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-base);
    border-radius: 0 8px 8px 0;
    margin-right: 12px;
    position: relative;
}

.sidebar a.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar a:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Затемнение фона при открытом меню */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 400;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Темная тема */
.tg-theme-dark .sidebar {
    background-color: var(--bg-secondary, #222222);
    border-right: 1px solid var(--divider-color, rgba(255, 255, 255, 0.1));
}

.tg-theme-dark .sidebar a {
    color: var(--text-primary, #a5bcd5);
}

.tg-theme-dark .sidebar-header {
    border-bottom-color: var(--divider-color, rgba(255, 255, 255, 0.1));
}