/* ===================================================
   TEKNİK SERVİS SİSTEMİ - ANA STİL DOSYASI
   Türkçe destekli, Modern, Mobil-Öncelikli
   =================================================== */

/* Inter fontu - Türkçe subset dahil */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&subset=latin,latin-ext&display=swap');

/* ─── CSS Değişkenleri ─────────────────────────────── */
:root {
    --bg:           #f0f4f8;
    --bg-card:      #ffffff;
    --bg-sidebar:   #ffffff;
    --text:         #1a202c;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --accent:       #5b21b6;
    --accent-light: #7c3aed;
    --accent-bg:    rgba(91,33,182,.08);
    --success:      #059669;
    --warning:      #d97706;
    --danger:       #dc2626;
    --info:         #0284c7;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
    --shadow-md:    0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
    --radius:       .75rem;
    --radius-sm:    .5rem;
    --transition:   .22s ease;
}

[data-theme="dark"] {
    --bg:           #0d1117;
    --bg-card:      #161b22;
    --bg-sidebar:   #0d1117;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --border:       #30363d;
    --accent:       #a78bfa;
    --accent-light: #c4b5fd;
    --accent-bg:    rgba(167,139,250,.12);
    --success:      #2ea043;
    --warning:      #d29922;
    --danger:       #f85149;
    --info:         #388bfd;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
    --shadow-md:    0 4px 16px rgba(0,0,0,.4);
    --shadow-lg:    0 8px 32px rgba(0,0,0,.5);
}

/* ─── TEMEL SIFIRLAMALAR ───────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html { font-size:16px; scroll-behavior:smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── LAYOUT WRAPPER ───────────────────────────────── */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 1.5rem 1rem;
}

@media (min-width: 992px) {
    .main-content { padding: 2rem 1.5rem; }
}

/* ─── ANIMASYONLAR ─────────────────────────────────── */
@keyframes fadeUp {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes pulse-dot {
    0%,100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.3); opacity: .7; }
}

.fade-in { animation: fadeUp .35s ease both; }

/* ─── NAVBAR ───────────────────────────────────────── */
.navbar {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: .75rem 1rem;
    transition: background var(--transition), border-color var(--transition);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent) !important;
    letter-spacing: -.5px;
    gap: .5rem;
}

.navbar .nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem .85rem !important;
    border-radius: var(--radius-sm);
    transition: all .18s ease;
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--accent) !important;
    background: var(--accent-bg);
}

.navbar .nav-link.active {
    font-weight: 600;
}

.navbar-toggler {
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    padding: .4rem .65rem !important;
    border-radius: var(--radius-sm) !important;
}

.navbar-toggler:focus { box-shadow: none !important; }

/* ─── TEMA BUTON ────────────────────────────────────── */
.theme-toggle-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .18s ease;
    flex-shrink: 0;
}
.theme-toggle-btn:hover {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
}

/* ─── DROPDOWN MENÜ ─────────────────────────────────── */
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius) !important;
    padding: .5rem !important;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    padding: .55rem .9rem !important;
    font-size: .88rem;
    font-weight: 500;
    transition: all .15s ease;
}

.dropdown-item:hover {
    background: var(--accent-bg) !important;
    color: var(--accent) !important;
}

.dropdown-item.active, .dropdown-item:active {
    background: var(--accent) !important;
    color: #fff !important;
}

.dropdown-divider { border-color: var(--border) !important; }

/* ─── KARTLAR ───────────────────────────────────────── */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border-color var(--transition),
                box-shadow .2s ease, transform .2s ease;
    overflow: hidden;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.25rem 1.5rem !important;
}

.card-body { padding: 1.5rem !important; }

/* ─── İSTATİSTİK KARTLARI ───────────────────────────── */
.stat-card {
    cursor: pointer;
    border-left: 3px solid transparent !important;
    transition: transform .2s ease, box-shadow .2s ease !important;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .7;
}

.stat-card .stat-icon {
    font-size: 1.8rem;
    opacity: .25;
}

.stat-bekleyen  { border-left-color: var(--warning)  !important; }
.stat-onarimda  { border-left-color: var(--accent)   !important; }
.stat-testte    { border-left-color: var(--info)      !important; }
.stat-tamamlandi{ border-left-color: var(--success)   !important; }
.stat-iptal     { border-left-color: var(--danger)    !important; }

/* ─── FORMLAR ───────────────────────────────────────── */
.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text);
    margin-bottom: .4rem;
}

.form-control, .form-select {
    background: var(--bg) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    padding: .65rem 1rem !important;
    font-size: .93rem;
    font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease !important;
}

.form-control::placeholder { color: var(--text-muted); opacity: .7; }

.form-control:focus, .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-bg) !important;
    outline: none;
}

.form-control-lg, .form-select-lg {
    padding: .8rem 1.1rem !important;
    font-size: 1rem !important;
}

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

.input-group-text {
    background: var(--bg) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: .9rem;
}

/* ─── BUTONLAR ──────────────────────────────────────── */
.btn {
    font-family: inherit;
    font-weight: 600;
    border-radius: var(--radius-sm) !important;
    transition: all .18s ease !important;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.25rem !important;
    font-size: .9rem;
    letter-spacing: .01em;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.btn-primary:hover {
    background: var(--accent-light) !important;
    border-color: var(--accent-light) !important;
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

.btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}

.btn-outline-secondary {
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
    background: transparent !important;
}
.btn-outline-secondary:hover {
    background: var(--bg) !important;
    color: var(--text) !important;
}

.btn-sm {
    padding: .4rem .85rem !important;
    font-size: .82rem !important;
}

.btn-lg {
    padding: .9rem 1.75rem !important;
    font-size: 1rem !important;
}

/* ─── TABLOLAR ──────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table {
    color: var(--text) !important;
    margin-bottom: 0 !important;
    min-width: 700px;
    width: 100%;
}

.table thead th {
    background: var(--bg) !important;
    color: var(--text-muted) !important;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 2px solid var(--border) !important;
    padding: .85rem .9rem !important;
    white-space: nowrap;
}

.table tbody td {
    padding: .9rem .9rem !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: .88rem;
    vertical-align: middle;
}

.table tbody tr { transition: background .12s ease; }

.table tbody tr:hover td { background: var(--accent-bg); }

.table tbody tr:last-child td { border-bottom: none !important; }

/* ─── DURUM BADGE'LERİ ──────────────────────────────── */
.badge {
    font-weight: 600;
    border-radius: 20px !important;
    padding: .35em .85em !important;
    font-size: .75rem;
    letter-spacing: .02em;
}

.badge-bekleyen  { background: rgba(217,119,6,.15);  color: var(--warning); }
.badge-onarimda  { background: var(--accent-bg);     color: var(--accent); }
.badge-testte    { background: rgba(2,132,199,.13);  color: var(--info); }
.badge-tamamlandi{ background: rgba(5,150,105,.13);  color: var(--success); }
.badge-iptal     { background: rgba(220,38,38,.13);  color: var(--danger); }

/* ─── GİRİŞ SAYFASI ─────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #5b21b6 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

[data-theme="dark"] .login-card {
    background: var(--bg-card);
}

.login-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 16px rgba(91,33,182,.4);
}

/* ─── ARAMA SONUÇ ALANI ──────────────────────────────── */
#search-results-container { display: none; }
#search-results-container.show { display: block !important; }

/* ─── DURUM DROPDOWN ─────────────────────────────────── */
.status-btn {
    border: none !important;
    font-size: .78rem !important;
    font-weight: 600 !important;
    padding: .32rem .75rem !important;
    border-radius: 20px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}

/* ─── SERVİS SÜRESİ PILL ─────────────────────────────── */
.duration-badge {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .2rem .6rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

/* ─── KULLANICI KARTI ─────────────────────────────────── */
.user-card {
    transition: transform .18s ease, box-shadow .18s ease;
}
.user-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
}

.user-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
    flex-shrink: 0;
}

/* ─── FOOTER ─────────────────────────────────────────── */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.25rem;
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
    transition: background var(--transition), border-color var(--transition);
}

/* ─── ALERT ──────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-sm) !important;
    border: none !important;
    font-size: .88rem;
}
.alert-success { background: rgba(5,150,105,.12) !important; color: var(--success) !important; }
.alert-danger  { background: rgba(220,38,38,.12) !important; color: var(--danger) !important; }
.alert-warning { background: rgba(217,119,6,.12) !important; color: var(--warning) !important; }
.alert-info    { background: rgba(2,132,199,.12) !important; color: var(--info) !important; }

/* ─── SCROLLBAR (WebKit) ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── RESPONSIVE MOBİL DÜZENLEMELERİ ────────────────── */
@media (max-width: 767px) {
    .card-body { padding: 1.1rem !important; }
    .card-header { padding: 1rem 1.1rem !important; }
    .main-content { padding: 1rem .75rem; }
    
    .stat-card .stat-value { font-size: 1.6rem; }
    .stat-card .card-body { padding: .9rem !important; }
    
    .btn { padding: .6rem 1rem !important; }
    .btn-lg { padding: .8rem 1.25rem !important; }
    
    .table { font-size: .82rem; }
    .table thead th { font-size: .68rem; padding: .7rem .6rem !important; }
    .table tbody td { padding: .75rem .6rem !important; }
    
    .login-card { padding: 1.75rem 1.25rem; }

    /* Mobil navbar menü */
    .navbar-collapse { 
        padding: .75rem 0;
        border-top: 1px solid var(--border);
        margin-top: .5rem;
    }
    .navbar .nav-link { padding: .65rem .75rem !important; }
}

@media (max-width: 575px) {
    .main-content { padding: .75rem .5rem; }
}
