/* ==================== ÖDEV DÖKÜMAN STİLLERİ ==================== */

.homework-document {
    background: white;
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Document Header */
.hw-doc-header {
    padding: 1.5rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.hw-doc-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}
.hw-doc-header.math, .hw-doc-header.matematik { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.hw-doc-header.turkish, .hw-doc-header.turkce { background: linear-gradient(135deg, #ef4444, #f97316); }
.hw-doc-header.lifescience, .hw-doc-header.hayatBilgisi { background: linear-gradient(135deg, #22c55e, #84cc16); }
.hw-doc-header.science, .hw-doc-header.fen { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.hw-doc-header.social, .hw-doc-header.sosyal { background: linear-gradient(135deg, #f97316, #eab308); }
.hw-doc-header.english, .hw-doc-header.ingilizce { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.hw-doc-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.hw-doc-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.25rem; }
.hw-doc-header p { opacity: 0.9; font-size: 0.95rem; }
.hw-doc-icon { font-size: 2.5rem; opacity: 0.9; }
.hw-doc-icon svg { width: 3rem; height: 3rem; opacity: 0.9; }

/* Student Info */
.hw-doc-student {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: #f8fafc;
    border-bottom: 2px dashed #e2e8f0;
}
@media (min-width: 640px) { .hw-doc-student { grid-template-columns: repeat(4, 1fr); } }
.hw-doc-student .field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 0.35rem;
}
.hw-doc-student .field .line {
    border-bottom: 2px dotted #cbd5e1;
    min-height: 1.5rem;
}

/* Questions */
.hw-doc-questions { padding: 1.5rem 2rem; }
.hw-doc-questions h2 { 
    font-size: 1.1rem; 
    font-weight: 800; 
    color: #1e293b; 
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.questions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
}
.questions-grid.single-column {
    grid-template-columns: 1fr;
}
@media (max-width: 640px) {
    .questions-grid { grid-template-columns: 1fr; }
}
.q-item { margin-bottom: 1.5rem; page-break-inside: avoid; }
.q-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.q-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
}
.q-number.math, .q-number.matematik { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.q-number.turkish, .q-number.turkce { background: linear-gradient(135deg, #ef4444, #f97316); }
.q-number.lifescience, .q-number.hayatBilgisi { background: linear-gradient(135deg, #22c55e, #84cc16); }
.q-number.science, .q-number.fen { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.q-number.social, .q-number.sosyal { background: linear-gradient(135deg, #f97316, #eab308); }
.q-number.english, .q-number.ingilizce { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.q-text { font-size: 1rem; line-height: 1.6; color: #1e293b; flex: 1; }
.q-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-left: 2.75rem;
    margin-top: 0.5rem;
}
.q-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}
.q-option-letter {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    background: white;
}
.q-answer-line {
    margin-left: 2.75rem;
    border-bottom: 2px dotted #94a3b8;
    height: 2rem;
    margin-top: 0.5rem;
}
.q-blank {
    margin-left: 2.75rem;
    border-bottom: 2px dotted #94a3b8;
    height: 2rem;
}
.q-short { margin-left: 2.75rem; }
.q-short .line {
    border-bottom: 2px dotted #94a3b8;
    height: 2rem;
    margin-bottom: 0.5rem;
}

/* Math Vertical */
.math-vertical-operation {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin-left: 2.75rem;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
}
.math-vertical-operation .num { padding: 0.1rem 0; }
.math-vertical-operation .operator-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.math-vertical-operation .operator {
    color: #6366f1;
    font-weight: 900;
}
.math-vertical-operation .line-separator {
    width: 100%;
    border-top: 3px solid #1e293b;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
}
.math-vertical-operation .answer-line {
    min-height: 2rem;
    min-width: 3rem;
    border-bottom: 2px dotted #94a3b8;
}

/* Answer Key */
.hw-doc-answers {
    padding: 1.5rem 2rem;
    background: #f0fdf4;
    border-top: 3px solid #22c55e;
}
.hw-doc-answers.hidden { display: none; }
.hw-doc-answers h2 {
    font-size: 1rem;
    font-weight: 800;
    color: #166534;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}
.answer-item {
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #bbf7d0;
}
.answer-item strong { color: #166534; }

/* Footer */
.hw-doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
}
.hw-doc-footer .site { font-weight: 700; color: #6366f1; }

/* Grayscale */
.homework-document.grayscale {
    filter: grayscale(100%);
}

/* ==================== KATEGORİ AĞACI ==================== */
.category-tree { margin-top: 1rem; }
.category-tree-class {
    margin-bottom: 0.75rem;
}
.category-tree-class > .tree-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 800;
    color: var(--primary);
    transition: all 0.3s;
    border: 2px solid transparent;
}
.category-tree-class > .tree-item:hover {
    border-color: var(--primary);
}
.category-tree-class > .tree-item svg { width: 1.25rem; height: 1.25rem; }
.category-tree-class > .tree-item .arrow {
    margin-left: auto;
    transition: transform 0.3s;
}
.category-tree-class.open > .tree-item .arrow { transform: rotate(90deg); }

.tree-subjects {
    display: none;
    margin-left: 1rem;
    margin-top: 0.5rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
}
.category-tree-class.open .tree-subjects { display: block; }

.tree-subject {
    margin-bottom: 0.5rem;
}
.tree-subject > .tree-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.875rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s;
    font-size: 0.9rem;
}
.tree-subject > .tree-item:hover { border-color: var(--primary); color: var(--primary); }
.tree-subject > .tree-item svg { width: 1rem; height: 1rem; }
.tree-subject > .tree-item .arrow {
    margin-left: auto;
    transition: transform 0.3s;
    color: var(--text-muted);
}
.tree-subject.open > .tree-item .arrow { transform: rotate(90deg); color: var(--primary); }
.tree-subject > .tree-item .count {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    margin-left: auto;
    margin-right: 0.5rem;
}

.tree-topics {
    display: none;
    margin-left: 1rem;
    margin-top: 0.35rem;
    padding-left: 0.75rem;
    border-left: 2px solid #e2e8f0;
}
.tree-subject.open .tree-topics { display: block; }

.tree-topic {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
}
.tree-topic:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
}
.tree-topic svg { width: 0.875rem; height: 0.875rem; color: var(--text-muted); }
.tree-topic .topic-count {
    margin-left: auto;
    background: white;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Subject Icons */
.icon-turkish { color: #ef4444; }
.icon-math { color: #6366f1; }
.icon-lifescience { color: #22c55e; }
.icon-science { color: #06b6d4; }
.icon-social { color: #f97316; }
.icon-english { color: #8b5cf6; }

/* ==================== ÖDEV KARTLARI ==================== */
.homework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.homework-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    transition: all 0.3s;
    cursor: pointer;
    display: block;
    box-shadow: var(--shadow-sm);
}
.homework-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-color);
}

/* ==================== ÖDEV LİSTE (UZUN SATIR) ==================== */
.homework-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.homework-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-2xl);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
    transition: all 0.25s;
    position: relative;
}
.homework-list-item:hover {
    transform: translateY(-4px) scale(1.005);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
}
.homework-list-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(99,102,241,0.05), rgba(236,72,153,0.05), rgba(6,182,212,0.05));
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.homework-list-item:hover::after {
    opacity: 1;
}
.homework-list-item .hw-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}
.homework-list-item .hw-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}
.hw-list-content {
    flex: 1;
    min-width: 0;
}
.hw-list-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.hw-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.hw-list-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
}
.hw-list-meta svg {
    width: 0.95rem;
    height: 0.95rem;
}
.hw-list-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    font-weight: 700;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(99,102,241,0.25);
    background: rgba(99,102,241,0.1);
}
.hw-list-actions a:hover {
    background: rgba(99,102,241,0.15);
    border-color: var(--primary);
}

/* Renkli temalar (satır bazlı) */
.homework-list-item.turkish { border-left: 8px solid #ef4444; background: linear-gradient(135deg, #fff7f7 0%, #fffefe 100%); }
.homework-list-item.math { border-left: 8px solid #6366f1; background: linear-gradient(135deg, #f3f5ff 0%, #ffffff 100%); }
.homework-list-item.lifescience { border-left: 8px solid #22c55e; background: linear-gradient(135deg, #f2fff6 0%, #ffffff 100%); }
.homework-list-item.science { border-left: 8px solid #06b6d4; background: linear-gradient(135deg, #f0fcff 0%, #ffffff 100%); }
.homework-list-item.social { border-left: 8px solid #f97316; background: linear-gradient(135deg, #fff6ed 0%, #ffffff 100%); }
.homework-list-item.english { border-left: 8px solid #8b5cf6; background: linear-gradient(135deg, #f5f0ff 0%, #ffffff 100%); }
.hw-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
}
.hw-icon svg { width: 1.5rem; height: 1.5rem; color: white; }
.hw-icon.math { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.hw-icon.turkish { background: linear-gradient(135deg, #ef4444, #f97316); }
.hw-icon.lifescience { background: linear-gradient(135deg, #22c55e, #84cc16); }
.hw-icon.science { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.hw-icon.social { background: linear-gradient(135deg, #f97316, #eab308); }
.hw-icon.english { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.homework-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--text-primary); }
.hw-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.hw-meta span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.hw-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}
.hw-stats span { display: flex; align-items: center; gap: 0.35rem; }
.hw-stats svg { width: 0.875rem; height: 0.875rem; }
.hw-stats a {
    margin-left: auto;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.hw-stats a:hover { text-decoration: underline; }

/* ==================== 404 PAGE ==================== */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 3rem;
    text-align: center;
}
.error-container h1 { font-size: 6rem; font-weight: 900; }
.error-container h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.error-container p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 400px; }

/* ==================== PRINT STYLES - TAM SAYFA ==================== */
@media print {
    @page { 
        margin: 0; 
        padding: 0; 
        size: A4 portrait;
    }
    html, body { 
        margin: 0 !important; 
        padding: 0 !important;
        background: white !important; 
        width: 210mm;
        height: 297mm;
    }
    .homework-document {
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-after: always;
    }
    .math-vertical-operation {
        background: transparent !important;
        border: none !important;
    }
    .no-print { display: none !important; }
}

