﻿/* # шрифты */
@font-face {
    font-family: 'Font1';
    src: url('fonts/1.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Font2';
    src: url('fonts/2/CormorantGaramond-VariableFont_wght.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Font3';
    src: url('fonts/3.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* # общий сброс */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* # цветовые переменные */
:root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface-soft: #f8f9fb;
    --border: #e7e8eb;
    --text: #111827;
    --muted: #6b7280;
    --accent: #111827;
    --accent-soft: rgba(17, 24, 39, 0.08);
    --shadow: 0 14px 50px rgba(15, 23, 42, 0.08);
}

/* # темная тема */
body.dark-theme {
    --bg: #111827;
    --surface: #1f2937;
    --surface-soft: #111827;
    --border: #334155;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --accent-soft: rgba(148, 163, 184, 0.16);
}

body.dark-theme .profile-cover {
    background: rgba(15, 23, 42, 0.65);
}

body.dark-theme .profile-avatar {
    border-color: rgba(255,255,255,0.16);
}

body.dark-theme .profile-banner {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

/* # основной текст и фон */
body {
    font-family: 'Font2', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 24px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 2;
}

/* # общий контейнер */
.container-app {
    width: min(1300px, 100%);
    margin: 32px auto;
    padding: 0 24px 32px;
}

/* # шапка */
header {
    padding: 24px 0 16px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

header h1 {
    font-family: 'Font1', system-ui, sans-serif;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.04em;
}

/* # профильный баннер */
.profile-banner {
    border-radius: 24px;
    min-height: 180px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #e2e8f0 0%, #ffffff 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.profile-cover {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    padding: 28px 24px;
    min-height: 180px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.55);
}

.profile-avatar {
    width: 94px;
    height: 94px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.92);
    background: var(--surface);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text);
    flex-shrink: 0;
}

.profile-text {
    flex: 1;
    min-width: 180px;
}

.profile-text h1 {
    margin: 0;
}

.profile-text .hero-text {
    margin: 10px 0 0;
    color: var(--text);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.profile-text p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

#profileSubtitle {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-top: 12px;
}

/* # кнопки профиля */
.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.profile-actions .auth-btn,
.profile-actions .clear-btn {
    min-width: 140px;
}

.clear-btn {
    background: var(--surface);
    color: var(--text);
}

.clear-btn:hover {
    background: var(--surface-soft);
}

/* # кнопки в шапке */
.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Убедитесь, что кнопки заголовка (гамбургер) остаются кликабельными поверх оверлея */
 

/* Убедитесь, что кнопки заголовка (гамбургер) остаются кликабельными поверх оверлея */


.theme-toggle,
.auth-btn,
.menu-toggle,
.clear-btn {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 12px 18px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease, border-color 0.25s ease, box-shadow 0.2s ease;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

/* подписи для input type=file стилизованы как кнопки */
.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
}

.file-label:hover {
    background: var(--surface-soft);
}

/* убрать временные стили file-label, если не используются */
.file-label { display: none; }

.theme-toggle:hover,
.auth-btn:hover,
.menu-toggle:hover,
.clear-btn:hover {
    background: var(--surface-soft);
    border-color: rgba(100, 116, 139, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.clear-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #475569;
}

.user-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.95rem;
}

header p {
    font-family: 'Font3', Georgia, serif;
    margin-top: 14px;
    color: var(--muted);
    max-width: 680px;
}

.header-slogan {
    font-family: 'Font1', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* # статистика */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0 0;
}

.stat-card {
    background: var(--surface);
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.05);
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.stat-value {
    font-size: 1.95rem;
    font-weight: 700;
}

/* # основной блок */
main {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
}

/* # боковая панель */
.sidebar {
    background: var(--surface);
    width: 360px;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

 

.sidebar h2 {
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.add-subject {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.add-subject input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}

.add-subject button {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    padding: 16px 18px;
    cursor: pointer;
    font-size: 1rem;
}

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

.subject-item {
    padding: 16px 18px;
    margin-bottom: 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.subject-item:hover {
    background: var(--surface-soft);
}

.subject-item.active {
    background: var(--surface-soft);
    border-color: rgba(17, 23, 34, 0.12);
}

.subject-item span {
    font-size: 0.95rem;
}

.content {
    overflow-y: auto;
}

/* # заголовок предмета */
.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 24px;
}

.subject-header h2 {
    font-size: clamp(2rem, 2.5vw, 2.4rem);
    margin: 0;
}

.delete-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: #b91c1c;
    padding: 12px 18px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
}

.delete-btn:hover {
    background: #fef2f2;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.filter-section {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-section input,
.filter-section select,
.input-group input,
.input-group select,
.task-input-section textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    background: var(--surface);
    color: var(--text);
}

.filter-section input:focus,
.filter-section select:focus,
.input-group input:focus,
.input-group select:focus,
.task-input-section textarea:focus {
    outline: 2px solid rgba(17, 23, 39, 0.12);
}

/* # форма добавления задания */
.task-input-section {
    background: var(--surface);
    padding: 26px;
    border-radius: 24px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.task-input-section h3 {
    margin-bottom: 18px;
    color: var(--text);
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.task-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 16px;
}

.option-card {
    flex: 1;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.option-card label {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.option-card select {
    width: 100%;
    border-radius: 18px;
    padding: 14px 18px 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: #ffffff;
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    background-image: linear-gradient(45deg, transparent 50%, rgba(15, 23, 42, 0.75) 50%), linear-gradient(135deg, rgba(15, 23, 42, 0.75) 50%, transparent 50%);
    background-position: calc(100% - 16px) center, calc(100% - 10px) center;
    background-repeat: no-repeat;
    background-size: 6px 6px;
}

.option-card select:focus {
    outline: 2px solid rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.task-add-button {
    border: none;
    background: var(--text);
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    min-width: 140px;
    box-shadow: none;
}

.task-add-button:hover {
    background: rgba(15, 23, 42, 0.85);
}

.input-group button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
}

.input-group button:hover {
    background: var(--surface-soft);
}

.task-input-section textarea {
    min-height: 110px;
    resize: vertical;
}

/* # вкладки */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px;
}

.tab {
    border: none;
    background: transparent;
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.tab:hover {
    background: var(--surface-soft);
}

.tab.active {
    background: var(--text);
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* # список задач */
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subject-summary-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
}

.subject-summary-panel h4 {
    margin: 0 0 16px;
    color: var(--text);
}

.subject-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.subject-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface-soft);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.subject-summary-item:hover {
    background: var(--surface);
    transform: translateY(-1px);
}

.subject-summary-name {
    font-weight: 700;
    color: var(--text);
}

.subject-summary-count {
    color: var(--muted);
    font-size: 0.95rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 14px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.task-item:hover {
    transform: translateY(-1px);
    border-color: #d7d7d7;
}

.task-item.completed {
    opacity: 0.9;
}

.task-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.task-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.task-text {
    font-size: 1rem;
    color: var(--text);
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--muted);
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.task-notes {
    padding: 14px;
    background: var(--surface-soft);
    border-radius: 14px;
    color: var(--text);
    border: 1px solid var(--border);
}

.delete-btn,
.task-delete-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: #b91c1c;
    padding: 10px 14px;
    cursor: pointer;
}

.delete-btn:hover,
.task-delete-btn:hover {
    background: var(--surface-soft);
}

.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

/* # календарь */
.calendar-widget {
    background: var(--surface);
    padding: 22px;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.calendar-controls button {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px 14px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.calendar-controls button:hover {
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.calendar-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: capitalize;
}

.calendar-info {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.calendar-selected-tasks {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--muted);
    border: 1px solid var(--border);
}

.calendar-note-panel {
    margin-top: 18px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
}

.calendar-note-panel h4 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--text);
}

.calendar-note-panel textarea {
    width: 100%;
    min-height: 110px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    font-size: 1rem;
}

.calendar-note-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.calendar-note-text {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.calendar-header {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.calendar-day,
.calendar-empty {
    min-height: 92px;
    border-radius: 16px;
}

.calendar-empty {
    background: transparent;
}

.calendar-day {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.calendar-day:hover {
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.calendar-day.has-tasks {
    border-color: rgba(59, 130, 246, 0.35);
}

.calendar-day.has-note {
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.2);
}

.calendar-day.today {
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.45);
}

.calendar-day.today span {
    color: #991b1b;
    font-weight: 700;
}

.calendar-day.active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.85);
}

.calendar-day span {
    font-size: 0.85rem;
    color: var(--muted);
}

.calendar-day small {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #2563eb;
}

.calendar-day-note {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.2;
    max-height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 22px 40px rgba(15, 15, 15, 0.2);
    z-index: 1000;
}

/* # мобильная версия */
@media (max-width: 980px) {
    main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .desktop-only {
        display: none;
    }
}

@media (max-width: 680px) {
    header {
        padding: 20px 0 14px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-section,
    .input-group {
        flex-direction: column;
    }

    .task-item {
        flex-direction: column;
    }
}

