/* --- CSS VARIABLES (LIGHT & DARK THEMES) --- */
:root {
    --bg-main: #f4f7fb; /* Daha yumşaq fon */
    --bg-card: #ffffff;
    --bg-header: rgba(30, 41, 59, 0.95); /* Footer-in açıq tonu */
    --header-text: #f8fafc; /* Header yazıları üçün açıq rəng */
    --header-text-hover: #60a5fa; /* Hover edəndə diqqət çəkən göy */
    
    --bg-footer: #0f172a;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    
    --primary: #2563eb; /* Daha canlı göy */
    --primary-hover: #1d4ed8;
    --secondary: #f59e0b; /* Amber */
    
    --border-color: #e2e8f0;
    
    /* Modern Shadows */
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.08);
    --btn-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
    
    --input-bg: #f8fafc;
    --btn-dark: #0f172a;
    --btn-dark-hover: #1e293b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

[data-theme="dark"] {
    --bg-main: #0b1120;
    --bg-card: #1e293b;
    --bg-header: rgba(15, 23, 42, 0.95);
    --header-text: #f8fafc;
    --header-text-hover: #93c5fd;
    
    --bg-footer: #020617;
    --text-main: #cbd5e1;
    --text-muted: #94a3b8;
    --text-heading: #f8fafc;
    
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary: #fbbf24;
    
    --border-color: #334155;
    
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.5);
    --btn-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
    
    --input-bg: #0f172a;
    --btn-dark: #3b82f6;
    --btn-dark-hover: #2563eb;
}

/* --- ÜMUMİ RESET VƏ TƏMƏL --- */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0; padding: 0; 
    background-color: var(--bg-main);
    display: flex; flex-direction: column; min-height: 100vh;
    color: var(--text-main);
    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 1.6;
}

/* --- HEADER (MODERN GLASSMORPHISM) --- */
header {
    background-color: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 99999 !important; 
    box-shadow: 0 1px 0 var(--border-color); /* Sadəcə incə alt xətt */
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- LOGO DİZAYNI --- */
.logo { display: flex; align-items: center; }
.logo a {
    text-decoration: none; display: flex; align-items: center; padding: 0; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.logo a:hover { transform: scale(1.05); }
.logo-img { height: 42px; width: auto; display: block; object-fit: contain; }
.logo h1 { 
    color: var(--header-text); margin: 0; font-size: 24px; text-transform: none; 
    font-weight: 800; letter-spacing: -0.5px; height: 42px;
    display: flex; align-items: center; transition: color 0.4s ease;
}
.logo span { color: var(--header-text-hover); font-weight: 900; }

/* --- NAVİQASİYA --- */
nav#mainNav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
nav#mainNav ul li a {
    color: var(--header-text) !important;
    text-decoration: none !important;
    font-weight: 600; font-size: 15px; padding: 0 16px;
    border-radius: var(--radius-sm); transition: all 0.2s ease; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent !important; border: none !important; gap: 8px;
}
nav#mainNav ul li a:hover { 
    background: rgba(255, 255, 255, 0.1) !important; 
    color: var(--header-text-hover) !important;
}

/* Bildiriş Sistemi & Theme Toggle */
.notif-bell-wrapper, .theme-toggle { position: relative; font-size: 20px !important; padding: 0 12px !important; cursor:pointer; color: var(--header-text); }
.theme-toggle:hover, .notif-bell-wrapper:hover { transform: translateY(-2px); transition: 0.2s ease; color: var(--header-text-hover); }
.notif-badge-custom {
    position: absolute; top: -2px; right: 2px; background: #ef4444; color: white;
    font-size: 11px; padding: 2px 6px; border-radius: 50%; border: 2px solid var(--bg-header);
    font-weight: 800; line-height: 1; transition: border-color 0.4s ease;
}
.logout-txt { color: var(--text-muted) !important; }
.logout-txt:hover { color: #ef4444 !important; background: rgba(239, 68, 68, 0.1) !important; }

/* --- HAMBURGER --- */
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 6px; padding: 5px; }
.hamburger span { width: 28px; height: 3px; background: var(--header-text); border-radius: 3px; transition: 0.3s; }

/* --- LAYOUT (3 SÜTUNLU) --- */
.container {
    display: flex; flex-direction: row; max-width: 1400px;
    margin: 30px auto; gap: 24px; padding: 0 20px; width: 100%;
    align-items: flex-start; position: relative; z-index: 1;
}
.sidebar-left, .sidebar-right, .main-content {
    background: var(--bg-card); padding: 24px; border-radius: var(--radius-lg);
    border: 1px solid var(--border-color); box-shadow: var(--card-shadow);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}
.sidebar-left, .sidebar-right { flex: 1; min-width: 280px; }
.main-content { flex: 3; min-width: 0; }

/* --- MÜASİR INPUT VƏ DÜYMƏLƏR --- */
.form-control, input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%; height: 48px; padding: 10px 16px;
    background: var(--input-bg); color: var(--text-main);
    border: 1.5px solid var(--border-color); border-radius: var(--radius-md);
    font-size: 15px; margin-bottom: 16px; transition: all 0.2s ease; outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}
.form-control:focus, input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: var(--bg-card);
}

.btn-primary, button[type="submit"] {
    height: 48px; padding: 0 24px;
    background-color: var(--primary); color: white;
    border: none; border-radius: var(--radius-md); font-weight: 600; font-size: 15px;
    cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--btn-shadow);
}
.btn-primary:hover, button[type="submit"]:hover {
    background-color: var(--primary-hover); transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* --- MƏQALƏ KARTI (POST CARD) --- */
.article-card {
    background: var(--bg-card); padding: 24px; border-radius: var(--radius-lg); 
    border: 1px solid var(--border-color);
    margin-bottom: 24px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-card:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--card-shadow-hover); 
    border-color: rgba(37, 99, 235, 0.3); 
}
.article-card h3 { 
    margin: 0 0 12px 0; color: var(--text-heading); font-size: 22px; 
    font-weight: 800; line-height: 1.3; transition: color 0.3s ease;
}
.article-card h3 a { color: inherit; text-decoration: none; }
.article-card h3 a:hover { color: var(--primary); }

.meta-info-new { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); margin-bottom: 16px; flex-wrap: wrap; font-weight: 500;}
.meta-info-new i { color: var(--primary); margin-right: 4px; }
.summary-text-new { color: var(--text-main); line-height: 1.7; font-size: 15px; margin-bottom: 20px; }

/* --- POST.PHP (OXUMA SƏHİFƏSİ) --- */
.post-container { 
    max-width: 900px; margin: 40px auto; padding: 60px; 
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow); border: 1px solid var(--border-color);
    position: relative; z-index: 1; min-height: 600px; 
    transition: all 0.4s ease;
}

.post-header-new { border-bottom: 1px solid var(--border-color); padding-bottom: 30px; margin-bottom: 40px; }
.btn-edit-inline {
    display: inline-flex; align-items: center; gap: 8px; background-color: rgba(245, 158, 11, 0.1); color: #b45309;
    padding: 8px 18px; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; font-weight: 700;
    transition: all 0.2s ease; white-space: nowrap; border: 1px solid transparent;
}
[data-theme="dark"] .btn-edit-inline { color: #fbbf24; }
.btn-edit-inline:hover { 
    background-color: var(--secondary); color: white; 
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); 
}

.post-module-tag { 
    display: inline-block; background: rgba(37, 99, 235, 0.1); color: var(--primary); 
    padding: 6px 16px; border-radius: 50px; font-size: 13px; margin-bottom: 20px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.post-title-new { font-size: 2.8rem; color: var(--text-heading); line-height: 1.2; margin: 0 0 20px 0; font-weight: 900; letter-spacing: -0.5px; }
.post-meta-new { display: flex; gap: 24px; color: var(--text-muted); font-size: 15px; font-weight: 500;}
.post-meta-new span i { color: var(--primary); margin-right: 6px; }

.post-content-new { 
    line-height: 1.9; font-size: 18px; color: var(--text-heading); 
    margin-top: 40px; min-height: 200px; 
}
.post-content-new p { margin-bottom: 1.5em; }
.post-content-new img { 
    max-width: 100%; height: auto; border-radius: var(--radius-lg); 
    margin: 30px 0; box-shadow: var(--card-shadow); 
}
.post-content-new h2, .post-content-new h3 { margin-top: 1.5em; margin-bottom: 0.8em; font-weight: 800; }

.comments-section { margin-top: 60px; background: var(--bg-main); padding: 40px; border-radius: var(--radius-lg); }

/* --- FOOTER SİSTEMİ --- */
.main-footer {
    background-color: var(--bg-footer); color: #f8fafc; padding: 70px 0 30px 0;
    margin-top: auto; border-top: 4px solid var(--primary);
}
.footer-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 50px; padding: 0 20px; }
.footer-column h4 { font-size: 18px; margin-bottom: 24px; color: white; font-weight: 800; position:relative;}
.footer-column h4::after { content: ''; position: absolute; left: 0; bottom: -10px; width: 40px; height: 3px; background: var(--primary); border-radius: 2px; }
.footer-column p { font-size: 15px; line-height: 1.7; color: #94a3b8; }
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column ul li { margin-bottom: 14px; }
.footer-column ul li a { color: #94a3b8; text-decoration: none; font-size: 15px; transition: all 0.2s ease; display: inline-flex; align-items: center; }
.footer-column ul li a::before { content: '→'; margin-right: 8px; opacity: 0; transform: translateX(-10px); transition: all 0.2s ease; color: var(--primary); }
.footer-column ul li a:hover { color: white; transform: translateX(5px); }
.footer-column ul li a:hover::before { opacity: 1; transform: translateX(0); }
.footer-bottom { text-align: center; margin-top: 70px; padding-top: 25px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 14px; color: #64748b; }

/* --- MOBİL RESPONSİVE --- */
@media (max-width: 992px) {
    .hamburger { display: flex; }
    nav#mainNav {
        display: none; position: absolute; top: 100%; left: 0; width: 100%;
        background: var(--bg-header); padding: 20px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
        z-index: 100000 !important; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
    }
    nav#mainNav.open { display: block !important; animation: slideDown 0.3s ease forwards; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
    nav#mainNav ul { flex-direction: column; gap: 10px; }
    nav#mainNav ul li { width: 100%; }
    nav#mainNav ul li a { width: 100%; justify-content: flex-start; height: 48px; }
    .container { flex-direction: column !important; }
    .sidebar-left, .sidebar-right, .main-content { width: 100% !important; margin-bottom: 20px; }
    .footer-container { grid-template-columns: repeat(2, 1fr); gap: 30px;}
}

@media (max-width: 600px) {
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .footer-column h4::after { left: 50%; transform: translateX(-50%); }
    .post-container { padding: 30px 20px; margin: 15px; border-radius: var(--radius-md); }
    .post-title-new { font-size: 2rem; }
    .btn-edit-inline { width: 100%; justify-content: center; margin-top: 15px; }
    .meta-info-new, .post-meta-new { flex-direction: column; gap: 8px; }
}

/* --- QLOBAL ADMIN LAYOUT --- */
.global-admin-layout { display: flex; flex-direction: row; align-items: stretch; width: 100%; flex-grow: 1; }
.global-admin-layout .sidebar {
    width: 280px !important; flex-shrink: 0; min-height: calc(100vh - 72px);
    box-shadow: 4px 0 15px rgba(0,0,0,0.05); background-color: var(--bg-card);
    border-right: 1px solid var(--border-color); z-index: 100;
}
.global-admin-content { flex-grow: 1; width: calc(100% - 280px); display: flex; flex-direction: column; padding: 30px; }
@media (max-width: 992px) {
    .global-admin-layout .sidebar { display: none !important; }
    .global-admin-content { width: 100%; padding: 20px; }
}

/* ----------------------------------
   Ağıllı Terminlər (Smart Glossary) 
----------------------------------- */
.smart-term {
    position: relative;
    border-bottom: 2px dashed var(--primary);
    cursor: pointer;
    color: inherit;
    transition: all 0.2s ease;
    font-weight: 600;
}

.smart-term:hover {
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 4px;
}

.smart-term::after {
    content: attr(data-tooltip);
    position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(10px) scale(0.95);
    background-color: var(--text-heading); color: var(--bg-card);
    padding: 12px 18px; border-radius: var(--radius-md); font-size: 14px;
    white-space: pre-wrap; width: max-content; max-width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000; line-height: 1.6; text-align: left; font-weight: normal;
}

.smart-term::before {
    content: ""; position: absolute; bottom: 130%; left: 50%;
    transform: translateX(-50%) translateY(20px); border-width: 8px; border-style: solid;
    border-color: var(--text-heading) transparent transparent transparent;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 1000;
}

.smart-term:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0) scale(1); }
.smart-term:hover::before { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(16px); }

[data-theme="dark"] .smart-term::after { background-color: #334155; color: #f8fafc; }
[data-theme="dark"] .smart-term::before { border-color: #334155 transparent transparent transparent; }