/* ===== FerNote v4 Modern UI ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #eef2ff;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 4px 16px rgba(15,23,42,.08);
    --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --navbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
@media (max-width: 767px) { html { font-size: 14px; } }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #f0f4ff;
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: var(--navbar-h);
    line-height: 1.6;
}

/* Navbar */
.app-navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 60%, #4f46e5 100%);
    box-shadow: 0 2px 20px rgba(79,70,229,.35);
    z-index: 1030; padding: 0;
}
.app-navbar .container { height: 100%; display: flex; align-items: center; }
.navbar-brand {
    font-size: 1.3rem; font-weight: 700; letter-spacing: -.5px;
    color: #fff !important; text-decoration: none;
    display: flex; align-items: center; gap: .5rem;
}
.navbar-brand::before { content: "📝"; font-size: 1.1rem; }
.navbar-nav .nav-link {
    color: rgba(255,255,255,.8) !important; font-weight: 500;
    font-size: .88rem; padding: .45rem .85rem !important;
    border-radius: var(--radius-sm); transition: all .2s; text-decoration: none;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: #fff !important; background: rgba(255,255,255,.15);
}
.navbar-toggler { border: 1.5px solid rgba(255,255,255,.35); padding: .35rem .55rem; border-radius: var(--radius-sm); }
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba%28255,255,255,.85%29' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); }
@media (max-width: 991px) {
    .navbar-collapse { background: #1e1b4b; border-top: 1px solid rgba(255,255,255,.1); margin: 0 -12px; padding: .75rem 1rem; box-shadow: var(--shadow-lg); }
    .navbar-nav .nav-link { padding: .65rem 1rem !important; }
}

/* Page layout */
main.container { padding-top: 1.75rem; padding-bottom: 3rem; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.page-header h2, .page-header h1 { font-size: 1.6rem; font-weight: 700; margin: 0; letter-spacing: -.3px; }

/* Content card */
.content-card { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card {
    background: var(--surface); border-radius: var(--radius); padding: 1.25rem;
    box-shadow: var(--shadow); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: .3rem;
    position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
    text-decoration: none; color: inherit;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.stat-card.sc-blue::before   { background: linear-gradient(90deg,#4f46e5,#0ea5e9); }
.stat-card.sc-green::before  { background: linear-gradient(90deg,#10b981,#059669); }
.stat-card.sc-orange::before { background: linear-gradient(90deg,#f59e0b,#ef4444); }
.stat-card.sc-purple::before { background: linear-gradient(90deg,#8b5cf6,#d946ef); }
.stat-icon { font-size: 1.4rem; }
.stat-label { font-size: .75rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }

/* Note cards */
.note-card {
    background: var(--surface); border-radius: var(--radius); padding: 1.2rem;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: .5rem;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c7d2fe; }
.note-card h5 { font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.35; }
.note-card .note-meta { font-size: .8rem; color: var(--text-secondary); }
.note-card p { font-size: .87rem; color: var(--text-secondary); margin: 0; white-space: pre-line; flex: 1; }
.note-card .note-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.note-thumb { max-height: 200px; object-fit: cover; width: 100%; border-radius: var(--radius-sm); }
.note-detail-content { white-space: pre-line; font-size: .95rem; line-height: 1.75; }

/* Priority badges */
.priority-badge { display: inline-flex; align-items: center; padding: .22rem .6rem; border-radius: 999px; font-size: .73rem; font-weight: 600; }
.priority-low    { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0; }
.priority-medium { background:#fffbeb; color:#b45309; border:1px solid #fed7aa; }
.priority-high   { background:#fff7ed; color:#c2410c; border:1px solid #fca5a5; }
.priority-critical { background:#fef2f2; color:#b91c1c; border:1px solid #fca5a5; }

/* Tag badges */
.tag-badge {
    display: inline-flex; align-items: center;
    background: var(--primary-light); color: var(--primary-dark) !important;
    border: 1px solid #c7d2fe; border-radius: 999px;
    font-size: .73rem; font-weight: 500; padding: .18rem .6rem;
    text-decoration: none !important; transition: all .15s;
}
.tag-badge:hover { background: var(--primary); color: #fff !important; border-color: var(--primary); }

/* Student cards */
.student-card {
    background: var(--surface); border-radius: var(--radius); padding: 1rem 1.2rem;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    transition: transform .2s, box-shadow .2s;
}
.student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.student-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem; color: #fff; flex-shrink: 0;
}
.student-info { flex: 1; min-width: 0; }
.student-name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-meta { font-size: .78rem; color: var(--text-secondary); }
.student-actions { display: flex; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; }
.note-count-badge { display: inline-flex; align-items: center; gap: .3rem; background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c7d2fe; border-radius: 999px; font-size: .72rem; font-weight: 600; padding: .12rem .55rem; }

/* Category cards */
.category-card {
    background: var(--surface); border-radius: var(--radius); padding: 1rem 1.2rem;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    transition: transform .2s, box-shadow .2s;
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.category-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.category-info { flex: 1; min-width: 0; }
.category-name { font-weight: 600; font-size: .95rem; }
.category-desc { font-size: .8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* Forms */
.form-card { max-width: 1100px; }
.form-label { font-weight: 500; font-size: .85rem; color: var(--text-secondary); margin-bottom: .4rem; }
.form-control, .form-select {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .9rem; padding: .55rem .9rem; color: var(--text-primary);
    background: var(--surface); transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); outline: none; }
textarea.form-control { resize: vertical; min-height: 130px; }
.form-section { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.25rem; }
.form-section-title { font-weight: 600; font-size: .85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .75rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-switch .form-check-input { width: 2.5em; height: 1.35em; }

/* Buttons */
.btn {
    font-weight: 500; font-size: .88rem; border-radius: var(--radius-sm);
    padding: .5rem 1rem; transition: all .2s; border-width: 1.5px;
    display: inline-flex; align-items: center; gap: .4rem;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border); background: transparent; }
.btn-outline-secondary:hover { background: var(--surface-3); color: var(--text-primary); border-color: #cbd5e1; }
.btn-outline-danger { color: var(--danger); border-color: #fca5a5; background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-outline-dark { color: var(--text-primary); border-color: #94a3b8; background: transparent; }
.btn-outline-dark:hover { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.btn-sm { font-size: .8rem; padding: .32rem .7rem; }
.btn-lg { font-size: .95rem; padding: .65rem 1.4rem; }

/* Filter */
.filter-card { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 1.25rem; }

/* Empty state */
.empty-state { border: 2px dashed #cbd5e1; border-radius: var(--radius); padding: 3rem 1.5rem; text-align: center; color: var(--text-muted); background: var(--surface); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state p { font-size: .95rem; margin: 0; }

/* Reminder cards */
.reminder-card { background: var(--surface); border-radius: var(--radius-sm); padding: 1rem 1.2rem; border-left: 4px solid var(--warning); box-shadow: var(--shadow-sm); border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.reminder-card.completed { border-left-color: var(--success); opacity: .8; }

/* Toast */
.fn-toast-wrap { position: fixed; top: calc(var(--navbar-h) + 12px); right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; }
.fn-toast { min-width: 270px; max-width: 360px; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: .85rem 1.1rem; display: flex; align-items: flex-start; gap: .75rem; border: 1px solid var(--border); animation: slideInRight .3s ease; }
.fn-toast .toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }
.fn-toast .toast-msg { flex: 1; font-size: .87rem; font-weight: 500; }
.fn-toast .toast-close { cursor: pointer; color: var(--text-muted); transition: color .15s; }
.fn-toast .toast-close:hover { color: var(--text-primary); }
.fn-toast.t-success { border-left: 4px solid var(--success); }
.fn-toast.t-warning { border-left: 4px solid var(--warning); }
.fn-toast.t-danger  { border-left: 4px solid var(--danger); }
@keyframes slideInRight { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Reminder modal */
.reminder-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(4px); z-index: 1060; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.reminder-modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.reminder-modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.reminder-modal-body { padding: 1.25rem 1.5rem; }
.reminder-modal-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: .75rem; }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }
.qa-btn { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1rem .75rem; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text-primary); font-size: .82rem; font-weight: 500; transition: all .2s; text-align: center; }
.qa-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.qa-icon { font-size: 1.5rem; }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-cloud-item { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px; background: var(--primary-light); border: 1px solid #c7d2fe; color: var(--primary-dark); font-size: .8rem; font-weight: 500; text-decoration: none; transition: all .15s; }
.tag-cloud-item .tc-count { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 .4rem; font-size: .7rem; font-weight: 700; }
.tag-cloud-item:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Info rows */
.info-row { display: flex; align-items: center; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--surface-3); font-size: .88rem; }
.info-row:last-child { border-bottom: none; }
.info-row .info-label { font-weight: 500; color: var(--text-secondary); min-width: 110px; }

/* Badges */
.badge { font-weight: 600; font-size: .73rem; padding: .28rem .6rem; border-radius: 999px; }
.text-bg-success   { background: #d1fae5 !important; color: #065f46 !important; }
.text-bg-secondary { background: var(--surface-3) !important; color: var(--text-secondary) !important; }
.text-bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.text-bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.text-bg-dark      { background: #1e293b !important; color: #f8fafc !important; }

/* Validation */
.text-danger { font-size: .8rem; }
.validation-summary-errors { font-size: .85rem; }

/* Upload zone */
.upload-zone { border: 2px dashed #c7d2fe; border-radius: var(--radius); padding: 2rem; text-align: center; background: var(--primary-light); cursor: pointer; transition: border-color .2s; }
.upload-zone:hover { border-color: var(--primary); background: #e0e7ff; }

/* Progress */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); }
.progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }

/* Section header */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title { font-size: 1rem; font-weight: 600; margin: 0; }

/* Responsive */
@media (max-width: 576px) {
    .content-card, .filter-card { padding: .9rem; border-radius: var(--radius-sm); }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.6rem; }
    .page-header h2 { font-size: 1.25rem; }
    main.container { padding-top: 1.25rem; }
    .student-card { flex-wrap: wrap; }
}

/* ===== Tam genişlik kart düzeni ===== */
.note-card .note-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.note-card .note-body {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.note-card .note-body-main { flex: 1; min-width: 0; }

.note-card .note-body-aside {
    flex-shrink: 0;
    width: 200px;
}

@media (max-width: 767px) {
    .note-card .note-body { flex-direction: column; }
    .note-card .note-body-aside { width: 100%; }
}

/* Tam genişlik not satırı */
.note-card-full {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary-light);
    transition: box-shadow .2s, border-color .2s;
    margin-bottom: .15rem;
}

.note-card-full:hover {
    box-shadow: var(--shadow);
    border-left-color: var(--primary);
}

.note-card-full.p-low      { border-left-color: #10b981; }
.note-card-full.p-medium   { border-left-color: #f59e0b; }
.note-card-full.p-high     { border-left-color: #f97316; }
.note-card-full.p-critical { border-left-color: #ef4444; }

/* Öğrenci kartı tam genişlik */
.student-card-full {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow .2s, border-color .2s;
}

.student-card-full:hover {
    box-shadow: var(--shadow);
    border-color: #c7d2fe;
}

/* Kategori kartı tam genişlik */
.category-card-full {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow .2s, border-color .2s;
}

.category-card-full:hover {
    box-shadow: var(--shadow);
    border-color: #c7d2fe;
}
