/* ============ ОСНОВНЫЕ СТИЛИ ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container { 
    max-width: 500px; 
    margin: 0 auto; 
    animation: fadeIn 0.5s ease;
}

.card { 
    background: white; 
    padding: 25px; 
    border-radius: 20px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0,0,0,0.4);
}

h1 { 
    color: #2c3e50; 
    margin-bottom: 15px; 
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============ КНОПКИ ============ */
.btn { 
    width: 100%; 
    padding: 16px; 
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white; 
    border: none; 
    border-radius: 12px; 
    font-size: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    margin: 10px 0; 
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover { 
    transform: translateY(-3px) scale(1.02); 
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.btn:active { 
    transform: translateY(-1px) scale(0.98); 
}

.btn-telegram { 
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.btn-telegram:hover {
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.btn-toggle {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn-toggle:hover {
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

/* ============ ФОРМЫ ============ */
.input-field {
    width: 100%; 
    padding: 15px; 
    margin: 8px 0; 
    border: 2px solid #e0e0e0; 
    border-radius: 12px; 
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-field:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* ============ СТАТИСТИКА ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transform: translateY(0);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============ КАЛЕНДАРЬ ============ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}

.day-header {
    text-align: center;
    padding: 10px;
    font-weight: 700;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.day {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

.day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

.day:hover::before {
    opacity: 1;
}

.day:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 10;
}

.day.past {
    background: #f8f9fa;
    color: #999;
    position: relative;
}

.day.past::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: #ddd;
    transform: rotate(-45deg);
}

.day.today {
    border: 3px solid #4CAF50;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2E7D32;
    font-weight: bold;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4),
                    0 4px 15px rgba(76, 175, 80, 0.2); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0),
                    0 4px 15px rgba(76, 175, 80, 0.2); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0),
                    0 4px 15px rgba(76, 175, 80, 0.2); 
    }
}

.day.done {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.day.done::after {
    content: '✓';
    position: absolute;
    font-size: 10px;
    top: 4px;
    right: 4px;
    opacity: 0.9;
}

.day.missed {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.3);
}

.day.missed::after {
    content: '✕';
    position: absolute;
    font-size: 10px;
    top: 4px;
    right: 4px;
    opacity: 0.9;
}

.day.empty {
    background: transparent;
    cursor: default;
}

.day.empty:hover {
    transform: none;
    box-shadow: none;
}

/* ============ ДЕТАЛЬНАЯ СТАТИСТИКА ============ */
.stats-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    animation: fadeIn 0.6s ease;
}

.stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card-detailed {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card-detailed:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}

.stat-value-detailed {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.stat-label-detailed {
    font-size: 12px;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ============ ПРОГРАММА ============ */
.program-container {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4);
    animation: fadeIn 0.6s ease 0.1s both;
}

.week-plan {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #fff;
    transition: transform 0.3s ease;
}

.week-plan:hover {
    transform: translateX(5px);
}

.week-plan strong {
    color: #ffeb3b;
    display: block;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 700;
}

.week-plan em {
    color: #c8e6c9;
    font-style: normal;
    font-weight: 500;
}

.program-note {
    background: rgba(0, 0, 0, 0.25);
    padding: 20px;
    border-radius: 15px;
    margin-top: 25px;
    font-style: italic;
    text-align: center;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    font-size: 15px;
    line-height: 1.5;
}

/* ============ УТИЛИТЫ ============ */
.subtitle {
    text-align: center; 
    margin-bottom: 25px; 
    color: #666; 
    line-height: 1.6;
    font-size: 16px;
}

.or-divider {
    text-align: center; 
    margin: 25px 0; 
    color: #999; 
    font-size: 14px;
    position: relative;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e0e0e0;
}

.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

.form-title {
    margin-bottom: 25px; 
    text-align: center;
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
}

.app-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.logout-btn {
    background: none; 
    border: none; 
    color: #666; 
    cursor: pointer; 
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
}

.logout-btn:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.user-welcome {
    text-align: center; 
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.user-name {
    color: #4CAF50; 
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 700;
}

.user-motto {
    color: #666; 
    font-size: 15px;
    font-style: italic;
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.month-nav {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 8px 18px;
    color: #4CAF50;
    font-weight: bold;
    border-radius: 10px;
    transition: all 0.3s;
}

.month-nav:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: scale(1.1);
}

.month-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.action-buttons {
    margin-top: 30px;
}

/* ============ СТАТУСЫ ============ */
.status { 
    padding: 18px; 
    background: #f8f9fa; 
    border-radius: 12px; 
    margin-top: 25px; 
    font-size: 15px;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.success { 
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724; 
    border-color: #b1dfbb;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.1);
}

.error { 
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24; 
    border-color: #f1b0b7;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.1);
}

.info { 
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460; 
    border-color: #abdde5;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.1);
}

.hidden { 
    display: none !important; 
}

/* ============ ВЫБОР ПЕРИОДА ============ */
.period-selector {
    margin-top: 25px;
}

.period-select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
}

.period-select option {
    background: #667eea;
    color: white;
}

/* ============ АНИМАЦИИ ============ */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* ============ ТЕМНАЯ ТЕМА ============ */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .card {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    h1 {
        color: #e2e8f0;
    }
    
    .input-field {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .input-field:focus {
        border-color: #4CAF50;
        background: #4a5568;
    }
    
    .day.past {
        background: #4a5568;
        color: #a0aec0;
    }
    
    .day.today {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: #68d391;
        border-color: #68d391;
    }
    
    .month-header {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .month-title {
        color: #e2e8f0;
    }
    
    .user-welcome {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .user-motto {
        color: #a0aec0;
    }
    
    .app-header {
        border-bottom-color: #4a5568;
    }
    
    .logout-btn {
        color: #a0aec0;
    }
    
    .logout-btn:hover {
        color: #fc8181;
        background: rgba(252, 129, 129, 0.1);
    }
    
    .subtitle {
        color: #a0aec0;
    }
    
    .or-divider::before,
    .or-divider::after {
        background: #4a5568;
    }
    
    .status {
        background: #4a5568;
    }
}

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .card {
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stats-grid-detailed {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .program-container {
        padding: 20px;
    }
    
    .week-plan {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .day {
        font-size: 14px;
        border-radius: 8px;
    }
}

/* ============ ДЕТАЛЬНАЯ СТАТИСТИКА ============ */
.stats-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    animation: fadeIn 0.6s ease;
}

.stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card-detailed {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card-detailed:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}

.stat-value-detailed {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.stat-label-detailed {
    font-size: 12px;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ============ ПРОГРАММА ============ */
.program-container {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4);
    animation: fadeIn 0.6s ease 0.1s both;
}

.week-plan {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
    border-left: 5px solid #fff;
    transition: transform 0.3s ease;
}

.week-plan:hover {
    transform: translateX(5px);
}

.week-plan strong {
    color: #ffeb3b;
    display: block;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 700;
}

.week-plan em {
    color: #c8e6c9;
    font-style: normal;
    font-weight: 500;
}

.program-note {
    background: rgba(0, 0, 0, 0.25);
    padding: 20px;
    border-radius: 15px;
    margin-top: 25px;
    font-style: italic;
    text-align: center;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    font-size: 15px;
    line-height: 1.5;
}

/* ============ ВЫБОР ПЕРИОДА ============ */
.period-selector {
    margin-top: 25px;
}

.period-select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
}

.period-select option {
    background: #667eea;
    color: white;
}

/* ============ АНИМАЦИИ ============ */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ============ СЕКЦИИ ============ */
.section-title {
    text-align: center; 
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

/* ============ ТЕМНАЯ ТЕМА ДЛЯ СТАТИСТИКИ ============ */
@media (prefers-color-scheme: dark) {
    .stats-container {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
    
    .stat-card-detailed {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .program-container {
        background: linear-gradient(135deg, #805ad5 0%, #d53f8c 100%);
    }
    
    .week-plan {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .period-select {
        background: rgba(255, 255, 255, 0.1);
    }
}