:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --primary: #1f3d7a;
    --secondary: #2979ff;
    --accent: #47b881;
    --danger: #e74c3c;
    --text: #23304d;
    --muted: #64748b;
    --border: rgba(34, 51, 77, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #eef3fc 0%, #f7f9ff 100%);
    color: var(--text);
    direction: rtl;
}

.page-shell {
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px;
}

.hero {
    background: var(--primary);
    color: #fff;
    border-radius: 28px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(31, 61, 122, 0.12);
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 2.4vw, 3rem);
}

.hero p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
    opacity: 0.95;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 16px 30px rgba(79, 100, 140, 0.08);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--primary);
}

.card p,
.card ul,
.card label,
.card span,
.card small {
    line-height: 1.75;
    color: var(--muted);
}

.card ul {
    padding-right: 18px;
}

.card ul li {
    margin-bottom: 12px;
}

.form-card .field-group,
.task-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.form-card .half-grid,
.save-row,
.timer-buttons,
.stats-grid,
.summary-grid,
.motivation-cards {
    display: grid;
    gap: 12px;
}

.form-card .half-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button-row {
    display: flex;
    align-items: flex-end;
}

.form-card label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}

.form-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.form-card select,
.task-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 1rem;
}

.task-form input {
    flex: 1;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    padding: 14px 22px;
    background: var(--secondary);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.secondary {
    background: #4758ff;
}

button.muted {
    background: #f1f5f9;
    color: var(--text);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(41, 121, 255, 0.24);
}

.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.note-card {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-card label {
    font-weight: 700;
    color: var(--primary);
}

.note-card textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #f8fbff;
    color: var(--text);
    font-size: 1rem;
    resize: vertical;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #f9fbff;
    border: 1px solid rgba(41, 121, 255, 0.12);
}

.task-item.completed {
    opacity: 0.75;
    text-decoration: line-through;
}

.task-item label {
    flex: 1;
    cursor: pointer;
}

.task-item button {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.stats-grid,
.summary-grid,
.motivation-cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card,
.summary-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(41, 121, 255, 0.12);
    box-shadow: 0 10px 18px rgba(31, 61, 122, 0.06);
}

.stat-card strong,
.summary-card p {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.timer-section {
    margin-bottom: 32px;
}

.timer-card {
    background: var(--surface);
    border-radius: 28px;
    border: 1px solid var(--border);
    padding: 28px;
    box-shadow: 0 20px 44px rgba(79, 100, 140, 0.08);
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.timer-value {
    font-size: clamp(2.8rem, 4vw, 4.8rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--primary);
}

.timer-phase {
    font-size: 1rem;
    padding: 12px 18px;
    background: rgba(41, 121, 255, 0.1);
    border-radius: 999px;
    color: var(--secondary);
    font-weight: 700;
}

.timer-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timer-status {
    margin: 0;
    color: var(--text);
    opacity: 0.9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
}

.schedule-container {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: 0 20px 40px rgba(79, 100, 140, 0.07);
}

.plan-empty {
    text-align: center;
    color: var(--muted);
    padding: 28px;
    font-size: 1.05rem;
}

.schedule-card {
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
    background: linear-gradient(140deg, #eef5ff 0%, #ffffff 100%);
    border: 1px solid rgba(41, 121, 255, 0.14);
}

.schedule-card h3 {
    margin: 0 0 10px;
    color: var(--primary);
}

.schedule-card p {
    margin: 6px 0;
}

.time-label {
    font-weight: 700;
    color: var(--secondary);
}

.tag {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
}

.tag-study { background: rgba(71, 184, 129, 0.12); color: #147d42; }
.tag-break { background: rgba(231, 76, 60, 0.12); color: #a5271d; }

.motivation-section h2 {
    margin-bottom: 16px;
    color: var(--primary);
}

.motivation-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mini-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 26px rgba(31, 61, 122, 0.06);
}

.mini-card h3 {
    margin-top: 0;
    color: var(--secondary);
}

@media (max-width: 980px) {
    .cards-grid,
    .stats-grid,
    .summary-grid,
    .motivation-cards,
    .timer-buttons,
    .form-card .half-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 24px 18px;
    }

    .card {
        padding: 20px;
    }

    button {
        width: 100%;
    }
}

.plan-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
}

.schedule-container {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: 0 20px 40px rgba(79, 100, 140, 0.07);
}

.plan-empty {
    text-align: center;
    color: var(--muted);
    padding: 28px;
    font-size: 1.05rem;
}

.schedule-card {
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
    background: linear-gradient(140deg, #eef5ff 0%, #ffffff 100%);
    border: 1px solid rgba(41, 121, 255, 0.14);
}

.schedule-card h3 {
    margin: 0 0 10px;
    color: var(--primary);
}

.schedule-card p {
    margin: 6px 0;
}

.time-label {
    font-weight: 700;
    color: var(--secondary);
}

.tag {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
}

.tag-study { background: rgba(71, 184, 129, 0.12); color: #147d42; }
.tag-break { background: rgba(231, 76, 60, 0.12); color: #a5271d; }

.motivation-section h2 {
    margin-bottom: 16px;
    color: var(--primary);
}

.motivation-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
}

.mini-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 26px rgba(31, 61, 122, 0.06);
}

.mini-card h3 {
    margin-top: 0;
    color: var(--secondary);
}

@media (max-width: 980px) {
    .cards-grid,
    .motivation-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 24px 18px;
    }

    .card {
        padding: 20px;
    }

    button {
        width: 100%;
    }
}
