/* ==========================================================================
   PRATIK ACADEMY - NATIVE APP UI ARCHITECTURE
   Version: 4.1 (Complete Overhaul & Unified Navigation)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root[data-theme="dark"] {
    --app-bg: #0b0f19;
    --app-surface: #131b2f;
    --app-surface-hover: #1e293b;
    --app-border: rgba(255, 255, 255, 0.08);
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --primary: #4338ca;
    --primary-light: #6366f1;
    --primary-glow: 0 8px 24px rgba(99, 102, 241, 0.3);
    
    --warning: #f59e0b;
    --info: #0ea5e9;
    --success: #10b981;
    --danger: #ef4444;
    
    --sidebar-width: 280px;
    --header-height: 80px;
    --bottom-nav-height: 70px;
    --transition-app: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

:root[data-theme="light"] {
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-surface-hover: #f1f5f9;
    --app-border: rgba(0, 0, 0, 0.08);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-glow: 0 8px 24px rgba(79, 70, 229, 0.25);
    
    --warning: #d97706;
    --info: #0284c7;
    --success: #059669;
    --danger: #dc2626;
    
    --sidebar-width: 280px;
    --header-height: 80px;
    --bottom-nav-height: 70px;
    --transition-app: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- BASE APP SETTINGS --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; -webkit-tap-highlight-color: transparent; }
html, body {
    width: 100%; height: 100vh; overflow: hidden; /* Uygulama dışı kaymayı iptal eder */
    background-color: var(--app-bg); color: var(--text-main);
    user-select: none; /* Metin seçimini kapat (Native his) */
}
input, textarea, p, h1, h2, h3, h4, h5, h6, span { user-select: auto; }
a { text-decoration: none; color: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--app-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* --- APP SHELL LAYOUT --- */
.app-wrapper { display: flex; width: 100%; height: 100vh; overflow: hidden; }

/* --- UNIVERSAL APP NAVIGATION (Desktop & Mobile Sync) --- */
.universal-app-nav {
    width: var(--sidebar-width); 
    height: 100vh;
    background-color: var(--app-surface);
    border-right: 1px solid var(--app-border);
    display: flex; 
    flex-direction: column;
    padding: 24px 20px; 
    z-index: 100;
    transition: var(--transition-app);
}

.nav-desktop-header { display: block; margin-bottom: 10px; }
.nav-desktop-footer { display: block; margin-top: auto; }

.app-logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 40px; height: 40px; background: var(--primary);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem; box-shadow: var(--primary-glow);
}
.logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; }

.sidebar-user {
    display: flex; align-items: center; gap: 15px; padding: 16px;
    background: var(--app-bg); border-radius: 16px; margin-bottom: 20px;
    border: 1px solid var(--app-border);
}
.user-avatar { position: relative; }
.user-avatar img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; }
.status-indicator {
    position: absolute; bottom: -2px; right: -2px;
    width: 12px; height: 12px; background: var(--success);
    border: 2px solid var(--app-bg); border-radius: 50%;
}
.user-info h5 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.user-info span { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.nav-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 10px 0 10px 10px; }

.nav-links-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    flex: 1; 
    overflow-y: auto; 
    overflow-x: hidden; 
}

.nav-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 14px; color: var(--text-muted);
    font-weight: 600; font-size: 0.95rem; margin-bottom: 6px;
    transition: all 0.3s ease; position: relative; overflow: hidden;
    text-decoration: none;
}
.nav-item i { font-size: 1.4rem; transition: 0.3s; }
.nav-item:hover { color: var(--text-main); background: var(--app-surface-hover); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: var(--primary-glow); }

/* Masaüstü Merkez Buton Normalizasyonu */
.center-action .center-btn {
    display: flex; align-items: center; justify-content: flex-start;
    width: auto; height: auto; background: transparent; border: none; box-shadow: none; transform: none;
}
.center-action .center-btn i { font-size: 1.4rem; color: var(--warning); margin: 0; }
.center-action { border: 1px solid rgba(245, 158, 11, 0.2); background: rgba(245, 158, 11, 0.05); }
.center-action:hover { background: rgba(245, 158, 11, 0.15); }
.center-text { display: block; }

body.sidebar-collapsed .universal-app-nav { transform: translateX(-100%); }

/* --- APP MAIN CONTENT --- */
.app-main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }

/* App Header */
.app-header {
    height: var(--header-height); padding: 0 40px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(var(--app-bg), 0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--app-border); z-index: 10;
}
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }

.header-right { display: flex; align-items: center; gap: 20px; }
.app-search {
    display: flex; align-items: center; background: var(--app-surface);
    border: 1px solid var(--app-border); padding: 10px 20px;
    border-radius: 50px; width: 300px; transition: all 0.3s ease;
}
.app-search:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.app-search i { color: var(--text-muted); font-size: 1.2rem; }
.app-search input { background: transparent; border: none; outline: none; color: var(--text-main); margin-left: 10px; width: 100%; font-weight: 500; }

.app-btn-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--app-surface); border: 1px solid var(--app-border);
    color: var(--text-main); font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer; transition: 0.3s;
}
.app-btn-icon:hover { background: var(--app-surface-hover); transform: translateY(-2px); }
.badge-dot {
    position: absolute; top: 10px; right: 12px;
    width: 8px; height: 8px; background: var(--danger);
    border-radius: 50%; box-shadow: 0 0 0 2px var(--app-bg);
}

/* --- APP DROPDOWN MENU --- */
.profile-dropdown-toggle { position: relative; cursor: pointer; display: flex; align-items: center; }
.header-profile img { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; border: 2px solid var(--primary-light); }
.app-dropdown-menu {
    position: absolute; top: 120%; right: 0;
    background: var(--app-surface);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--app-border);
    border-radius: 16px; box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    width: 240px; padding: 10px 0;
    opacity: 0; visibility: hidden; transform: translateY(15px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1050;
}
.app-dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-item {
    display: flex; align-items: center; gap: 14px; padding: 12px 24px;
    color: var(--text-main); font-weight: 600; font-size: 0.95rem;
    transition: 0.3s; text-decoration: none;
}
.dropdown-item i { font-size: 1.2rem; }
.dropdown-item:hover { background: var(--app-surface-hover); padding-left: 28px; }
.dropdown-divider { height: 1px; background: var(--app-border); margin: 8px 0; }

/* Scrollable Content Area */
.app-content-scrollable {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 30px 40px 100px 40px; scroll-behavior: smooth;
}
.app-container { max-width: 1400px; margin: 0 auto; }

/* --- APP COMPONENTS --- */
.card {
    background: var(--app-surface); border: 1px solid var(--app-border);
    border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    margin-bottom: 24px; transition: 0.3s; overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); }
.card-body { padding: 30px; }
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; }

/* App Dashboard Stat Cards */
.bg-gradient-danger { background: linear-gradient(135deg, #f43f5e, #e11d48) !important; color: white !important; border: none !important; }
.bg-gradient-info { background: linear-gradient(135deg, #38bdf8, #0284c7) !important; color: white !important; border: none !important; }
.bg-gradient-success { background: linear-gradient(135deg, #34d399, #059669) !important; color: white !important; border: none !important; }

.widget-stat-card { position: relative; overflow: hidden; border: none !important; }
.widget-stat-card::after { 
    content: ''; position: absolute; top: -30%; right: -10%; 
    width: 140px; height: 140px; background: rgba(255,255,255,0.15); 
    border-radius: 50%; filter: blur(15px); pointer-events: none;
}

/* App Tables & Progress */
.app-table-wrapper { overflow-x: auto; padding: 5px; }
.app-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; text-align: left; }
.app-table th { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; font-weight: 800; padding: 0 20px 10px; border: none; letter-spacing: 0.5px; }
.app-table td { background: var(--app-bg); padding: 18px 20px; font-size: 0.9rem; font-weight: 600; border-top: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border); transition: 0.3s; }
.app-table td:first-child { border-left: 1px solid var(--app-border); border-radius: 16px 0 0 16px; }
.app-table td:last-child { border-right: 1px solid var(--app-border); border-radius: 0 16px 16px 0; }
.app-table tr:hover td { background: var(--app-surface-hover); transform: scale(1.01); }

.app-progress { height: 8px; background: rgba(255,255,255,0.2); border-radius: 10px; overflow: hidden; }
.app-progress-bar { height: 100%; border-radius: 10px; transition: width 1s ease; }

/* App Form Elements */
.form-control {
    background: var(--app-bg); border: 1px solid var(--app-border);
    color: var(--text-main); border-radius: 16px; padding: 14px 20px; font-weight: 500; width: 100%;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.btn-gradient-primary {
    background: var(--primary); color: white; border: none;
    padding: 14px 28px; border-radius: 16px; font-weight: 700;
    box-shadow: var(--primary-glow); cursor: pointer; transition: 0.3s;
}

/* Ripple Effect */
.ripple { position: relative; overflow: hidden; }
.ripple-circle {
    position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.3);
    transform: scale(0); animation: ripple-anim 0.6s linear; pointer-events: none;
}
[data-theme="light"] .nav-item:not(.active) .ripple-circle { background: rgba(0, 0, 0, 0.1); }
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* --- CUSTOM CURSOR --- */
.app-cursor {
    width: 8px; height: 8px; background: var(--primary); border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%);
}
.app-cursor-follower {
    width: 32px; height: 32px; border: 1.5px solid var(--primary-light); border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 9998; transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

/* --- RESPONSIVE APP DESIGN & MOBILE BOTTOM NAV --- */
@media (max-width: 992px) {
    .app-main { margin-left: 0; }
    .app-header { padding: 0 20px; }
    .app-content-scrollable { padding: 20px 20px 120px 20px; }
    .app-search { display: none; }
    .app-cursor, .app-cursor-follower { display: none !important; }
    * { cursor: auto !important; }

    /* Universal Nav -> Mobile Bottom Nav Dönüşümü */
    .universal-app-nav {
        flex-direction: row;
        width: 100%;
        height: var(--bottom-nav-height);
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        padding: 0 10px;
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--app-surface);
        border-right: none;
        border-top: 1px solid var(--app-border);
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        transform: none !important;
    }

    .nav-desktop-header, .nav-desktop-footer { display: none; }

    .nav-links-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 0;
        overflow: visible !important; /* Dışarı taşmaya izin ver */
    }

    .nav-item {
        flex-direction: column;
        justify-content: center;
        padding: 0;
        margin: 0;
        border-radius: 0;
        flex: 1;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important; /* KRİTİK: Butonun kırpılmasını engeller */
    }
    
    .nav-item i { font-size: 1.5rem; margin-bottom: 2px; }
    .nav-item.active { color: var(--primary-light); }
    .nav-item.active i { transform: translateY(-2px); }
    .nav-text { font-size: 0.65rem; font-weight: 600; }

    /* Mobilde Dışa Taşan Merkez Butonu */
    .center-action { position: relative; }
    .center-action .center-btn {
        position: absolute;
        top: -30px; /* Butonu menünün üstüne iter */
        left: 50%;
        transform: translateX(-50%);
        width: 56px;
        height: 56px;
        background: var(--primary);
        border-radius: 50%;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
        border: 5px solid var(--app-bg); /* App arka planı ile aynı renkte sınır kesimi */
        z-index: 10;
        overflow: hidden; /* Sadece yuvarlak butonun kendi içi taşmasın */
    }
    .center-action .center-btn i { font-size: 1.7rem; color: white; margin: 0; }
    .center-text { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); }
}