/* =========================================================
   style.css — YDS/YÖKDİL 60 Günlük Çalışma Takip
   ========================================================= */

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

/* ---------- CSS Variables ---------- */
:root {
    --primary:      #1e3a5f;   /* Koyu lacivert */
    --primary-light:#2d5f9e;
    --accent:       #3b82f6;   /* Parlak mavi */
    --success:      #22c55e;
    --danger:       #ef4444;
    --warning:      #f59e0b;
    --bg:           #f0f4f8;
    --surface:      #ffffff;
    --surface-2:    #f8fafc;
    --border:       #e2e8f0;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --sidebar-w:    280px;
    --radius:       12px;
    --shadow:       0 2px 12px rgba(30,58,95,.10);
    --shadow-lg:    0 8px 32px rgba(30,58,95,.16);
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =========================================================
   LAYOUT
   ========================================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-brand {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.sidebar-brand span {
    font-size: .75rem;
    color: rgba(255,255,255,.6);
    letter-spacing: .5px;
}

/* Progress bar inside sidebar */
.sidebar-progress {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-progress label {
    font-size: .72rem;
    color: rgba(255,255,255,.7);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 6px;
    display: block;
}
.prog-bar-wrap {
    background: rgba(255,255,255,.15);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}
.prog-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 99px;
    transition: width .5s ease;
}
.prog-label {
    font-size: .72rem;
    color: rgba(255,255,255,.7);
    margin-top: 5px;
}

/* Day list */
.day-search {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.day-search input {
    width: 100%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    padding: 7px 12px;
    color: #fff;
    font-size: .8rem;
    outline: none;
}
.day-search input::placeholder { color: rgba(255,255,255,.5); }
.day-search input:focus { border-color: rgba(255,255,255,.5); }

.day-list { flex: 1; overflow-y: auto; padding: 8px 0; }

.day-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    color: rgba(255,255,255,.75);
    font-size: .82rem;
    transition: background .2s, color .2s;
    border-left: 3px solid transparent;
}
.day-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.day-item.active {
    background: rgba(59,130,246,.25);
    color: #fff;
    font-weight: 600;
    border-left-color: var(--accent);
}
.day-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background .2s;
}
.day-item.active .day-badge {
    background: var(--accent);
}
.day-item.completed .day-badge::after {
    content: '✓';
    font-size: .65rem;
}

.day-group-label {
    padding: 10px 20px 4px;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    font-weight: 600;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 24px;
    max-width: 100%;
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.topbar-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.topbar-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.hamburger {
    display: none;
    background: none; border: none; cursor: pointer;
    font-size: 1.4rem; color: var(--primary);
}

/* ---- Stats row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 3px solid transparent;
}
.stat-card.primary   { border-top-color: var(--accent); }
.stat-card.success   { border-top-color: var(--success); }
.stat-card.warning   { border-top-color: var(--warning); }
.stat-card.danger    { border-top-color: var(--danger); }

.stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-sub   { font-size: .72rem; color: var(--text-muted); }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i { color: var(--accent); }
.card-body { padding: 20px; }

/* ---- PDF Viewer ---- */
.pdf-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.pdf-tab {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: .8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .2s;
    font-weight: 500;
}
.pdf-tab:hover { border-color: var(--accent); color: var(--accent); }
.pdf-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pdf-frame-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
    height: 520px;
}
.pdf-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.pdf-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 8px;
    font-size: .9rem;
}
.pdf-placeholder i { font-size: 2.5rem; opacity: .4; }

/* ---- SOP Checklist ---- */
.sop-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: background .2s, border-color .2s;
    cursor: pointer;
}
.sop-item:hover { border-color: var(--accent); background: #eff6ff; }
.sop-item.checked { background: #f0fdf4; border-color: var(--success); }
.sop-item.checked .sop-label { text-decoration: line-through; color: var(--text-muted); }

.sop-checkbox {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
    background: var(--surface);
}
.sop-item.checked .sop-checkbox {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.sop-label { font-size: .88rem; font-weight: 500; }

/* ---- Performance Form ---- */
.form-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-section { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.form-group .form-control, .form-group select {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .88rem;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.form-group .form-control:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Success rate badge */
.rate-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5f9e 100%);
    color: #fff;
    margin: 16px 0;
}
.rate-pct {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}
.rate-desc { font-size: .8rem; opacity: .8; }
.rate-ring {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    transition: all .4s;
}

/* ---- Buttons ---- */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,130,246,.35);
}
.btn-primary-custom:active { transform: translateY(0); }

.btn-save-sop {
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-save-sop:hover { opacity: .9; }

.btn-danger-sm {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .75rem;
    cursor: pointer;
    transition: all .2s;
}
.btn-danger-sm:hover { background: var(--danger); color: #fff; }

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp .3s ease forwards;
    max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.danger  { background: var(--danger); }

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

/* ---- Table ---- */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.tbl thead th {
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    letter-spacing: .3px;
}
.tbl thead th:first-child { border-radius: 8px 0 0 0; }
.tbl thead th:last-child  { border-radius: 0 8px 0 0; }
.tbl tbody tr:nth-child(even) { background: var(--surface-2); }
.tbl tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tbody tr:hover { background: #eff6ff; }
.tbl .badge-success { background: #dcfce7; color: #16a34a; padding: 3px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.tbl .badge-warning { background: #fef9c3; color: #ca8a04; padding: 3px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.tbl .badge-danger  { background: #fee2e2; color: #dc2626; padding: 3px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }

/* ---- Tabs (section navigation) ---- */
.section-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    gap: 2px;
}
.section-tab {
    padding: 10px 18px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.section-tab:hover { color: var(--accent); }
.section-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
    .overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 99;
    }
    .overlay.active { display: block; }
}
@media (max-width: 576px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 16px; }
}
