/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0088cc;
    --primary-dark: #006ba3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px; /* Место для навигации */
}

/* Навигация */
.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.nav-btn .icon {
    font-size: 24px;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Контент */
.content {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* Кнопки */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Список лекарств */
.medications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.medication-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.medication-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.medication-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.medication-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.medication-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.medication-status.active {
    background: #d4edda;
    color: #155724;
}

.medication-status.paused {
    background: #fff3cd;
    color: #856404;
}

.medication-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.medication-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Календарь */
.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dose-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.dose-date {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dose-time {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.dose-medication {
    color: var(--primary-color);
    font-weight: 500;
}

/* История */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item.taken {
    border-left: 4px solid var(--success-color);
}

.history-item.missed {
    border-left: 4px solid var(--danger-color);
}

/* Настройки */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.setting-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Форма */
form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Пустые состояния */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Ошибки */
.error {
    text-align: center;
    padding: 20px;
    color: var(--danger-color);
    background: #f8d7da;
    border-radius: 8px;
    margin: 20px 0;
}

/* Бейджи статусов */
.status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.taken {
    background: #d4edda;
    color: #155724;
}

.status-badge.missed {
    background: #f8d7da;
    color: #721c24;
}

/* Адаптивность */
@media (max-width: 480px) {
    .content {
        padding: 12px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .nav-btn .label {
        font-size: 10px;
    }
}

