/* --- گۆڕاوەکان بۆ دۆخی ڕووناکی و تاریکی --- */
:root {
    /* Light Mode (Default) */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-glass: rgba(255, 255, 255, 0.85);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #10b981;
    --secondary-hover: #059669;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border-soft: rgba(226, 232, 240, 0.7);
    --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --modal-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-glass: rgba(30, 41, 59, 0.85);
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-light: rgba(129, 140, 248, 0.15);
    --secondary: #34d399;
    --secondary-hover: #10b981;
    --text-main: #f8fafc;
    --text-light: #94a3b8;
    --border-soft: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    --input-bg: #0f172a;
    --modal-bg: rgba(30, 41, 59, 0.95);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Noto Kufi Arabic', Tahoma, sans-serif; transition: background-color 0.3s, border-color 0.3s, color 0.3s; }

body { background: var(--bg-gradient); color: var(--text-main); display: flex; flex-direction: column; align-items: center; padding: 4vh 2vw; min-height: 100vh; }

.print-only { display: none; }

.app-container { background: var(--card-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); width: 100%; max-width: 800px; border-radius: 24px; padding: 40px; box-shadow: var(--shadow-soft); border: 1px solid var(--border-soft); position: relative; }

/* سەرەوە و هاندان */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.theme-toggle { background: var(--border-soft); border: none; padding: 8px 12px; border-radius: 20px; cursor: pointer; color: var(--text-main); font-size: 1.2rem; }
h1 { text-align: center; color: var(--primary); font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 5px;}
.quote { text-align: center; color: var(--text-light); font-size: 0.95rem; font-style: italic; margin-bottom: 30px; }

/* پۆمۆدۆرۆ و تەندروستی دەروونی */
.widgets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.widget-card { background: var(--primary-light); padding: 15px; border-radius: 16px; border: 1px solid var(--border-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pomodoro-time { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.pomodoro-controls button { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; margin: 0 3px; }
.mental-health-btn { background: rgba(244, 63, 94, 0.1); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.2); padding: 12px; border-radius: 12px; cursor: pointer; font-weight: 600; transition: 0.3s; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 1rem;}
.mental-health-btn:hover { background: rgba(244, 63, 94, 0.2); transform: translateY(-2px); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.input-group { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 600; font-size: 0.95rem; color: var(--text-light); }
input[type="date"], select, input[type="number"], textarea { padding: 14px 18px; border: 1px solid var(--border-soft); border-radius: 14px; font-size: 1rem; outline: none; background: var(--input-bg); color: var(--text-main); font-weight: 500; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }

/* هێڵی پێشکەوتن و کات */
.status-box { background: var(--primary-light); border: 1px solid var(--border-soft); padding: 25px; border-radius: 16px; text-align: center; margin-bottom: 30px; position: relative; overflow: hidden; }
.days-number { font-size: 3.5rem; font-weight: 800; color: var(--primary); margin: 5px 0; line-height: 1; }
.progress-container { width: 100%; background: var(--border-soft); height: 8px; border-radius: 4px; margin-top: 15px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 1s ease-in-out; }

.header-actions { display: flex; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
button { background: var(--primary); color: white; border: none; padding: 14px 24px; border-radius: 14px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; }
button:hover { background: var(--primary-hover); transform: translateY(-3px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2); }
.btn-print { background: var(--secondary); }
.btn-print:hover { background: var(--secondary-hover); }

.subject-list { display: flex; flex-direction: column; gap: 14px; }
.subject-card { background: var(--input-bg); padding: 16px 24px; border-radius: 16px; border: 1px solid var(--border-soft); transition: 0.3s; display: flex; flex-direction: column; }
.subject-card:hover { border-color: var(--primary); }
.subject-header { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.subject-info { display: flex; align-items: center; gap: 16px; flex: 1; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; }
.sub-name { font-weight: 600; font-size: 1.1rem; color: var(--text-main); }
.sub-name.disabled { text-decoration: line-through; color: var(--text-light); }

.controls-group { display: flex; align-items: center; gap: 10px; }
.day-input { width: 70px; text-align: center; font-weight: 800; padding: 10px !important; }
.btn-icon { padding: 8px; background: transparent; color: var(--text-light); border: 1px solid var(--border-soft); border-radius: 10px; font-size: 1.1rem; }
.btn-icon:hover { background: var(--primary-light); color: var(--primary); transform: none; box-shadow: none; }

/* تێبینییەکانی وانە (Micro-tasks) */
.subject-notes { margin-top: 15px; display: none; }
.subject-notes.open { display: block; animation: fadeIn 0.3s ease; }
.subject-notes textarea { width: 100%; height: 80px; font-size: 0.9rem; resize: none; border-radius: 10px; }

.summary-message { text-align: center; font-weight: 600; margin-top: 25px; padding: 18px; border-radius: 16px; font-size: 1.05rem; border: 1px solid transparent; }

/* مۆداڵی دەروونی */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: 0.3s; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: var(--modal-bg); padding: 40px; border-radius: 24px; max-width: 400px; text-align: center; border: 1px solid var(--border-soft); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.modal-content h2 { color: #f43f5e; margin-bottom: 15px; font-size: 1.5rem; }
.modal-content p { color: var(--text-main); margin-bottom: 25px; line-height: 1.6; }
.modal-close { background: var(--text-light); width: 100%; }

.copyright-footer { margin-top: 40px; text-align: center; font-size: 0.95rem; color: var(--text-light); font-weight: 500; }
.copyright-footer a { color: var(--primary); text-decoration: none; font-weight: 800; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    .app-container { padding: 25px; }
    .grid-2, .widgets-grid { grid-template-columns: 1fr; gap: 15px; }
    .subject-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .controls-group { width: 100%; justify-content: space-between; }
    .header-actions { flex-direction: column; }
    button { width: 100%; }
}

/* --- چاپکردن --- */
@media print {
    /* ئەم دێڕە ناچاری وێبگەڕەکە دەکات ڕەنگەکان ڕێک وەک خۆی چاپ بکات */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page { size: A4; margin: 15mm; }
    body { background: white; padding: 0; color: #1e293b; display: block; }
    .no-print { display: none !important; }
    .app-container { box-shadow: none; padding: 0; max-width: 100%; border: none; }
    .print-only { display: block; }
    .print-header { text-align: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px dashed #cbd5e1; }
    .print-header h1 { color: #4f46e5; font-size: 22pt; margin-bottom: 10px; }
    .print-info { display: flex; justify-content: space-between; font-size: 12pt; margin-bottom: 20px; color: #475569; font-weight: 600; background: #f8fafc; padding: 10px; border-radius: 10px; }
    table { width: 100%; border-collapse: separate; border-spacing: 0 8px; direction: rtl; margin-top: 10px; }
    th, td { padding: 14px; text-align: right; font-size: 12pt; }
    th { background-color: #ffffff; color: #64748b; font-weight: bold; border-bottom: 2px solid #e2e8f0; text-align: right;}
    tbody tr td:first-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; font-weight: bold;}
    tbody tr td:last-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
    .print-footer { margin-top: 30px; text-align: center; font-size: 11pt; color: #64748b; font-weight: 600; padding: 20px; background: #f8fafc; border-radius: 12px;}
    .date-col { font-size: 11pt; color: #334155; }
    .date-col span { font-size: 9pt; color: #64748b; display: block; margin-top: 3px;}
}