/* ==========================================================
   YKS 2027 Kişisel Çalışma Programı - Bileşen Stilleri (Components)
   ========================================================== */

/* ----------------------------------------------------
   BUTONLAR (BUTTONS)
   ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    background-color: var(--bg-subtle);
    border-color: var(--bg-muted);
}

.btn-danger {
    background-color: var(--accent-danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}

/* ----------------------------------------------------
   BADGE & ETİKETLER
   ---------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-tyt {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-ayt {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-count {
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* ----------------------------------------------------
   PROGRAM TAKVİMİ / GÜN KARTLARI (SCHEDULE DAYS)
   7 Günlük (Pazartesi - Pazar) Haftalık Takvim Düzeni
   ---------------------------------------------------- */
.schedule-calendar-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 1.25rem;
    -webkit-overflow-scrolling: touch;
}

/* 7 Sütunlu Hafta Günleri Başlık Barı */
.calendar-weekdays-bar {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    min-width: calc(7 * 135px + 6 * 0.65rem);
    position: sticky;
    top: 0;
    z-index: 5;
}

.weekday-header-cell {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.4rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    user-select: none;
}

/* Hafta sonu günlerine şık vurgu */
.weekday-header-cell:nth-child(6),
.weekday-header-cell:nth-child(7) {
    color: var(--accent-blue);
    background-color: #fafbfc;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    gap: 0.65rem;
    min-width: calc(7 * 135px + 6 * 0.65rem);
}

/* Filtreli Görünüm (Bugün / Kalan Günler) için Esnek Grid */
.schedule-calendar-wrapper.is-filtered-view .calendar-weekdays-bar {
    display: none;
}

.schedule-calendar-wrapper.is-filtered-view .schedule-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    min-width: 0;
}

.day-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    overflow: hidden;
}

.day-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.day-card.is-today {
    border: 2px solid var(--accent-blue);
    position: relative;
}

.day-card.is-today::before {
    content: "BUGÜN";
    position: absolute;
    top: 0;
    right: 0.75rem;
    background-color: var(--accent-blue);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    z-index: 2;
}

.day-card.is-exam {
    border: 2px dashed var(--accent-amber);
    background-color: #fffdfa;
}

/* Takvimi Tamamlayan Program Öncesi / Sonu Dolgu Kartları */
.day-card.day-card-placeholder {
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    opacity: 0.5;
    pointer-events: none;
    box-shadow: none;
    user-select: none;
}

.day-card.day-card-placeholder .day-header {
    background-color: #f1f5f9;
}

.day-card.day-card-placeholder .day-number-title {
    color: var(--text-muted);
}

.day-card.day-card-placeholder .day-date-sub {
    color: var(--text-muted);
}

.day-placeholder-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    border: 1px dashed #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.day-header {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fafbfc;
}

.day-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.day-number-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.day-date-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-content {
    padding: 0.75rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 85px;
}

.day-empty-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
}

.day-footer {
    padding: 0.55rem 0.85rem;
    border-top: 1px solid var(--border-subtle);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
}

/* Gün İçindeki Ders Satırı (Schedule Item Row) */
.schedule-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.55rem;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    gap: 0.35rem;
}

.schedule-item-row:hover {
    background-color: #eaeff5;
}

.item-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Programı Kullan modu: Checkbox */
.custom-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #94a3b8;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    transition: all var(--transition-fast);
}

.custom-checkbox.checked {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: #ffffff;
}

.item-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.schedule-item-row .badge {
    padding: 0.1rem 0.35rem;
    font-size: 0.62rem;
    line-height: 1.1;
    border-radius: 4px;
    flex-shrink: 0;
}

.item-teacher {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tamamlanmış çalışma kartı stili */
.schedule-item-row.completed {
    opacity: 0.6;
    background-color: #f1f5f9;
}

.schedule-item-row.completed .item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.5rem;
}

.action-link-yt {
    color: #dc2626;
    display: flex;
    align-items: center;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.action-link-yt:hover {
    background-color: #fee2e2;
}

.action-delete-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.action-delete-btn:hover {
    color: var(--accent-danger);
    background-color: var(--accent-danger-subtle);
}

/* ----------------------------------------------------
   DERSLER KATALOĞU (SUBJECTS VIEW)
   ---------------------------------------------------- */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.subject-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.subject-card:hover {
    box-shadow: var(--shadow-md);
}

.subject-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.subject-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subject-card-teacher {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.subject-card-stats {
    background-color: var(--bg-subtle);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-bar-track {
    height: 8px;
    background-color: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-blue);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.subject-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.85rem;
    margin-top: auto;
}

/* ----------------------------------------------------
   İSTATİSTİK BÖLÜMÜ (STATS VIEW)
   ---------------------------------------------------- */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.5rem;
    letter-spacing: -1px;
}

.stat-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ----------------------------------------------------
   AYARLAR BÖLÜMÜ (SETTINGS VIEW)
   ---------------------------------------------------- */
.settings-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.settings-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.settings-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.settings-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 650px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.form-input, .form-select {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.danger-box {
    border: 1px solid #fecaca;
    background-color: #fff5f5;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* ----------------------------------------------------
   MODALLAR (MODALS)
   ---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.96);
    transition: transform var(--transition-fast);
}

.modal-overlay.open .modal-dialog {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #fafbfc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Modal içi Ders Seçim Listesi */
.subject-picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
    max-height: 340px;
    overflow-y: auto;
}

.picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    transition: all var(--transition-fast);
}

.picker-item:hover {
    border-color: var(--border-focus);
    background-color: var(--bg-subtle);
}

.picker-item.disabled {
    opacity: 0.5;
    background-color: #f8fafc;
    pointer-events: none;
}

.picker-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.picker-title {
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picker-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ----------------------------------------------------
   TOAST BİLDİRİM SİSTEMİ (TOASTS)
   ---------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-sidebar);
    color: #ffffff;
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    pointer-events: auto;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
    border-left: 4px solid var(--accent-blue);
}

.toast.toast-success {
    border-left-color: var(--accent-green);
}

.toast.toast-warning {
    border-left-color: var(--accent-amber);
}

.toast.toast-error {
    border-left-color: var(--accent-danger);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
