/* --- EN BAŞA: SIFIRLAMA --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.4);
    --neon-green: #00ff41;
    --neon-yellow: #ffee00;
    --neon-red: #ff003c;
    --bg: #121212; 
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --text-muted: #9ca3af;
    --border: #333;
    --input-bg: #252525;
    --modal-bg: #1e1e1e;
    --nav-btn-bg: rgba(255, 255, 255, 0.1);
    --nav-btn-hover: rgba(255, 255, 255, 0.2);
    --btn-icon-color: #fff;
    --gold: #fbbf24;
    --sidebar-bg: #181818;
}

[data-theme="light"] {
    --bg: #f3f4f6; 
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --input-bg: #f9fafb;
    --modal-bg: #ffffff;
    --nav-btn-bg: rgba(0, 0, 0, 0.05);
    --nav-btn-hover: rgba(0, 0, 0, 0.1);
    --btn-icon-color: #374151;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --sidebar-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    padding-bottom: 80px;
    display: flex;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- SIDEBAR --- */
.sidebar { position: fixed; top: 0; left: -280px; width: 280px; height: 100%; background: var(--sidebar-bg); border-right: 1px solid var(--border); z-index: 1000; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 20px; box-shadow: 5px 0 15px rgba(0,0,0,0.3); }
.sidebar.active { left: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.sidebar-header h2 { margin: 0; color: var(--primary); }
#closeSidebar { background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.menu-items { list-style: none; padding: 0; margin: 0; }
.menu-items li { margin-bottom: 10px; }
.menu-items a { display: flex; align-items: center; gap: 15px; padding: 12px 15px; color: var(--text); text-decoration: none; border-radius: 8px; transition: background 0.2s; font-weight: 500; }
.menu-items a:hover { background: var(--input-bg); }
.plus-item a { background: linear-gradient(45deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05)); border: 1px solid rgba(251, 191, 36, 0.3); color: var(--gold); }
.plus-item a:hover { background: linear-gradient(45deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1)); box-shadow: 0 4px 15px rgba(251, 191, 36, 0.2); }
.badge { background: var(--gold); color: #000; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; margin-left: auto; font-weight: bold; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 900; display: none; backdrop-filter: blur(2px); }
.overlay.active { display: block; }

/* --- NAV & HEADER --- */
/* --- NAVBAR DÜZENİ (SOLA HİZALI & DÜZGÜN) --- */
.nav-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;          /* Yan yana diz */
    align-items: center;    /* Dikey olarak ortala */
    gap: 15px;              /* Birbirlerine yapışmasınlar */
    z-index: 100;
    width: auto;            /* Sadece kapladığı yer kadar */
}

/* Profil Resmi Kutusu */
.profile-container {
    position: relative;
    display: inline-block;
    height: 40px;
    /* margin-left: auto; KODUNU KALDIRDIK Kİ SOLA GELSİN */
}

/* --- KRİTİK DÜZELTME: MENÜ ARTIK SOLA HİZALI AÇILACAK --- */
.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;       /* Resmin altına */
    
    left: 0 !important;   /* <--- İŞTE ÇÖZÜM BU! (Eskiden right:0 idi) */
    right: auto !important; /* Sağa yaslanmayı iptal et */
    
    width: 260px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 2000;
    margin-top: 10px;
    text-align: left;
}

/* Hover ile açılma */
.profile-container:hover .profile-dropdown {
    display: block;
    animation: fadeIn 0.2s ease;
}
.nav-btn {
    width: 40px; 
    height: 40px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    background: var(--nav-btn-bg); 
    color: var(--btn-icon-color); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1rem; 
    transition: all 0.2s; 
    backdrop-filter: blur(5px);
    flex-shrink: 0; /* ÖNEMLİ: Ekran küçülse bile buton büzüşmez */
}
.nav-btn:hover:not(.disabled) { 
    background: var(--nav-btn-hover); 
    transform: translateY(-2px); 
    border-color: var(--primary); 
}
.nav-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 65px; background: var(--card-bg); border-top: 1px solid var(--border); justify-content: space-around; align-items: center; z-index: 500; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.8rem; gap: 5px; transition: color 0.3s; }
.nav-item i { font-size: 1.3rem; transition: transform 0.2s; }
.nav-item.active, .nav-item:hover { color: var(--primary); }
.nav-item:active i { transform: scale(0.8); }

.main-container { width: 100%; max-width: 1100px; position: relative; }
header h1 { text-align: center; color: var(--primary); margin: 20px 0 30px 0; text-shadow: 0 0 15px var(--primary-glow); }
.card { background: var(--card-bg); padding: 25px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-bottom: 25px; border: 1px solid var(--border); transition: background 0.3s ease, border-color 0.3s ease; }

/* --- FORM --- */
.form-row { display: flex; gap: 15px; align-items: flex-start; flex-wrap: wrap; }
.input-group { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.button-group { display: flex; align-items: flex-end; height: 81px; padding-bottom: 20px; }
.input-group label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; padding-left: 2px; height: 20px; }
.input-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; font-style: italic; height: 15px; }
input, select, .custom-file-upload, button#addBtn { width: 100%; height: 48px; padding: 0 15px; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-size: 0.95rem; transition: all 0.3s ease; box-sizing: border-box; display: flex; align-items: center; }
input[type="text"], input[type="url"], input[type="date"] { line-height: 48px; }
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0); }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.custom-file-upload { cursor: pointer; border: 1px dashed var(--text-muted); color: var(--text-muted); justify-content: center; }
.custom-file-upload:hover { border-color: var(--primary); color: var(--primary); background: rgba(79, 70, 229, 0.05); }
.file-names { font-size: 0.75rem; color: var(--primary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button#addBtn { background: var(--primary); border: none; width: 50px; justify-content: center; font-size: 1.2rem; color: white; box-shadow: 0 4px 15px var(--primary-glow); cursor: pointer; }
button#addBtn:active { transform: scale(0.95); }

/* --- AKSİYON BARI --- */
.action-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.search-sort-group { display: flex; gap: 10px; flex: 1; min-width: 300px; } 
.search-container { flex: 1; position: relative; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#searchInput { padding-left: 40px; border-radius: 25px; border: 1px solid var(--border); background: var(--card-bg); height: 45px; }
#searchInput:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(79, 70, 229, 0.2); }
.search-dropdown { position: absolute; top: 110%; left: 0; width: 100%; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); z-index: 50; max-height: 300px; overflow-y: auto; display: none; }
.search-item { padding: 12px 15px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.search-item:hover { background: var(--input-bg); }
.search-item strong { color: var(--primary); }
.plus-teaser { padding: 15px; text-align: center; background: rgba(251, 191, 36, 0.1); border-top: 1px solid rgba(251, 191, 36, 0.3); color: var(--gold); font-size: 0.85rem; cursor: pointer; transition: background 0.2s; }
.plus-teaser:hover { background: rgba(251, 191, 36, 0.2); }
.bulk-actions { display: flex; gap: 10px; }
.action-btn { padding: 0 15px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: white; display: flex; align-items: center; gap: 8px; transition: transform 0.2s; height: 45px; white-space: nowrap; }
.action-btn:active { transform: scale(0.95); }
.btn-danger { background: #ef4444; }
.btn-warning { background: #f59e0b; color: #1e1e1e; }
.btn-sort { background: #6366f1; color: white; border-radius: 25px; }

/* --- TABLO & LİSTE --- */
@keyframes slideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.app-row { animation: slideIn 0.3s ease forwards; }
table { width: 100%; border-collapse: separate; border-spacing: 0 12px; }
th { text-align: left; color: var(--text-muted); padding: 10px 15px; font-size: 0.9rem; }
tr.app-row { background: var(--input-bg); transition: transform 0.2s; border-left: 4px solid transparent; }
/* Varsayılan Kenarlıklar */
tr.border-green { border-left-color: var(--neon-green) !important; box-shadow: -2px 0 15px -5px var(--neon-green); }
tr.border-yellow { border-left-color: var(--neon-yellow) !important; box-shadow: -2px 0 15px -5px var(--neon-yellow); }
tr.border-red { border-left-color: var(--neon-red) !important; box-shadow: -2px 0 15px -5px var(--neon-red); }
td { padding: 10px 15px; vertical-align: middle; }
.status-select { font-weight: 600; border: 1px solid var(--border); text-align: center; background: var(--input-bg) !important; color: var(--text); cursor: pointer; padding: 5px 15px; border-radius: 20px; -webkit-appearance: none; appearance: none; outline: none; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.status-select:hover { border-color: var(--text-muted); background: var(--bg) !important; }
.status-select option { background-color: var(--card-bg); color: var(--text); padding: 10px; }
.status-beklemede { color: #fcd34d !important; } [data-theme="light"] .status-beklemede { color: #d97706 !important; }
.status-olumlu { color: #6ee7b7 !important; } [data-theme="light"] .status-olumlu { color: #059669 !important; }
.status-olumsuz { color: #fca5a5 !important; } [data-theme="light"] .status-olumsuz { color: #dc2626 !important; }
.link-wrapper { display: flex; align-items: center; gap: 10px; }
a.link-btn { color: #60a5fa; text-decoration: none; background: rgba(96, 165, 250, 0.1); padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 5px; height: 32px; }
a.link-btn:hover { background: rgba(96, 165, 250, 0.2); }
.pdf-icon { color: #ef4444; font-size: 1.2rem; cursor: help;}
.delete-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; transition: all 0.3s; padding: 8px; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.delete-btn:hover { color: #ef4444; background: rgba(255,255,255,0.05); }
.delete-btn.confirm-mode { color: #fbbf24; transform: rotate(360deg) scale(1.1); background: rgba(251, 191, 36, 0.1); }
.export-area { text-align: right; margin-top: 20px; }
.export-btn { background: #10b981; color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: background 0.2s; }
.export-btn:hover { background: #059669; }
.site-footer { text-align: center; margin-top: 50px; padding: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(5px); }
.modal-box { background: var(--modal-bg); padding: 30px; border-radius: 12px; text-align: center; max-width: 400px; width: 90%; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.5); color: var(--text); }
.modal-icon { font-size: 3rem; color: #10b981; margin-bottom: 15px; }
.modal-box h3 { margin: 0 0 10px 0; color: var(--text); }
.modal-box p { color: var(--text-muted); margin-bottom: 25px; font-size: 0.9rem; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }
.btn-cancel { background: var(--border); color: var(--text); border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; }
.btn-confirm { background: #10b981; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; }
.btn-cancel:hover { opacity: 0.8; } .btn-confirm:hover { background: #059669; }

/* --- AYARLAR SAYFASI --- */
.settings-card { padding: 0; overflow: hidden; }
.settings-card h3 { background: rgba(255,255,255,0.05); padding: 15px 20px; margin: 0; border-bottom: 1px solid var(--border); font-size: 1.1rem; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.setting-item { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.setting-item:last-child { border-bottom: none; }
.setting-item.disabled { opacity: 0.5; cursor: not-allowed; background: rgba(0,0,0,0.1); }
.setting-info label { display: block; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.setting-desc { font-size: 0.85rem; color: var(--text-muted); margin: 0; max-width: 400px; line-height: 1.4; }
.badge-gray { background: var(--border); color: var(--text-muted); font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; font-weight: bold; }
.setting-control { display: flex; align-items: center; gap: 15px; }

/* AYARLAR: KUTU AKTİF EFEKTİ (NEON) */
#borderSettingsRow { transition: all 0.3s ease; border-left: 4px solid transparent; border-radius: 8px; }
#borderSettingsRow.active-glow { border-left-color: var(--neon-green) !important; box-shadow: -2px 0 15px -5px var(--neon-green) !important; background: rgba(0, 255, 65, 0.02); }

/* YENİ TOGGLE SWITCH */
.switch { position: relative; display: inline-block; width: 60px; height: 32px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #2a2a2a; border: 1px solid #444; transition: .4s cubic-bezier(0.23, 1, 0.32, 1); border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 24px; width: 24px; left: 4px; bottom: 3px; background-color: #aaa; transition: .4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
input:checked + .slider { background-color: var(--neon-green); border-color: var(--neon-green); box-shadow: 0 0 15px rgba(0, 255, 65, 0.6); }
input:checked + .slider:before { transform: translateX(28px); background-color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
input:focus + .slider { box-shadow: 0 0 5px var(--neon-green); }

/* --- KENARLIKLARI GİZLEME --- */
body.hide-borders .app-row,
body.hide-borders #borderSettingsRow { border-left-color: transparent !important; box-shadow: none !important; }

/* --- LOGIN SAYFASI TASARIMI --- */
body.login-page { height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at top left, #1e1e2f, #121212); }
.login-card { background: var(--card-bg); padding: 40px; border-radius: 20px; width: 100%; max-width: 400px; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center; position: relative; overflow: hidden; z-index: 1; transition: all 0.3s ease; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--primary), var(--neon-green)); }
.login-header .rocket-icon { font-size: 3rem; color: var(--primary); margin-bottom: 15px; filter: drop-shadow(0 0 10px var(--primary-glow)); animation: float 3s ease-in-out infinite; }
.login-header h2 { margin-bottom: 5px; color: var(--text); }
.login-header p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; }
.input-wrapper { position: relative; }
.input-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.login-card input { padding-left: 45px; background: var(--input-bg); border: 1px solid var(--border); }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.login-btn { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 10px; transition: all 0.3s; display: flex; justify-content: center; align-items: center; gap: 10px; }
.login-btn:hover { background: #4338ca; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3); }
.login-footer { margin-top: 30px; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 15px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* --- LOGIN/REGISTER EKLEMELERİ --- */
.login-links { display: flex; justify-content: space-between; margin-top: 20px; font-size: 0.9rem; }
.login-links.center-link { justify-content: center; }
.login-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.login-links a:hover { color: var(--primary); text-decoration: underline; }

/* --- LOGIN/REGISTER: SÖZLEŞME ALANI --- */
.agreements { margin: 20px 0; text-align: left; font-size: 0.85rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 12px; }
.agreement-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.4; transition: color 0.3s; }
.agreement-label:hover { color: var(--text); }
.agreement-label input[type="checkbox"] { -webkit-appearance: none; appearance: none; background-color: var(--input-bg); margin: 0; width: 18px; min-width: 18px; height: 18px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; position: relative; top: 2px; transition: all 0.2s; }
.agreement-label input[type="checkbox"]:checked { background-color: var(--primary); border-color: var(--primary); box-shadow: 0 0 5px var(--primary-glow); }
.agreement-label input[type="checkbox"]:checked::after { content: '✔'; font-size: 12px; color: white; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: bold; }
.agreement-label strong { color: var(--primary); }

/* HATA/BAŞARI MESAJLARI */
.message { padding: 15px 20px; border-radius: 8px; font-size: 0.95rem; margin-bottom: 25px; display: flex; align-items: flex-start; justify-content: flex-start; text-align: left; gap: 12px; width: 100%; box-sizing: border-box; line-height: 1.5; }
.message i { flex-shrink: 0; margin-top: 4px; }
.error-message { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.success-message { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }

/* --- STAJ TAKİP NEDİR? (MODAL) --- */
.what-is-section { margin-top: 25px; border-top: 1px solid var(--border); padding-top: 15px; }
.info-toggle-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: color 0.3s; }
.info-toggle-btn:hover { color: var(--primary); }

.info-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.info-overlay.active { opacity: 1; pointer-events: auto; }
.info-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); width: 90%; max-width: 450px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 40px 30px; z-index: 1000; box-shadow: 0 25px 50px rgba(0,0,0,0.5); text-align: center; opacity: 0; pointer-events: none; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.info-modal.active { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.close-info-btn { position: absolute; top: 15px; right: 15px; background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; transition: color 0.3s; padding: 5px; }
.close-info-btn:hover { color: #ef4444; }
.info-icon-wrapper { font-size: 3rem; color: var(--primary); margin-bottom: 20px; text-shadow: 0 0 20px var(--primary-glow); }
.info-modal h3 { color: var(--text); margin-bottom: 15px; font-size: 1.5rem; }
.info-text { color: var(--text-muted); line-height: 1.6; margin-bottom: 25px; font-size: 0.95rem; }
.info-text strong { color: var(--text); font-weight: 600; }
.info-divider { height: 1px; background: var(--border); width: 60%; margin: 0 auto 25px auto; }
.info-persuasion { color: var(--neon-green); font-weight: 700; font-size: 1rem; margin: 0; text-shadow: 0 0 10px rgba(0, 255, 65, 0.2); }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; } 
    .form-row { flex-direction: column; }
    .button-group { width: 100%; height: auto; padding-bottom: 0;}
    button#addBtn { width: 100%; }
    thead { display: none; }
    .action-bar { flex-direction: column; align-items: stretch; }
    .search-sort-group { flex-direction: column; }
    tr.app-row { display: flex; flex-direction: column; margin-bottom: 15px; background: var(--card-bg); border: 1px solid var(--border); padding: 15px; border-radius: 10px; position: relative; }
    td { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
    td:last-child { border-bottom: none; }
    td::before { content: attr(data-label); color: var(--text-muted); font-weight: 600; font-size: 0.8rem; }
    td:first-child { justify-content: flex-start; border-bottom: none; padding-bottom: 0; }
    td[data-label="Firma"] { justify-content: center; font-size: 1.2rem; font-weight: bold; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: 10px; margin-bottom: 5px; }
    td[data-label="Firma"]::before { display: none; }
    td[data-label="Firma"] strong { text-align: center; width: 100%; }
    td[data-label="Durum"] .status-select { width: auto !important; min-width: 120px; height: 36px; padding: 0 10px; font-size: 0.85rem; }
    .drag-cell { position: absolute; top: 15px; right: 15px; padding: 0; border: none; width: auto; }
    .action-cell { margin-top: 10px; justify-content: flex-end; border: none; }
    .login-card { padding: 30px; width: 90%; }
}

/* --- DUYURULAR & ADMIN PANELİ --- */
.admin-panel { border: 1px solid var(--primary); background: rgba(79, 70, 229, 0.03); padding: 25px; }
.panel-header h3 { margin: 0 0 20px 0; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.custom-textarea { width: 100%; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 15px; font-family: 'Segoe UI', sans-serif; font-size: 0.95rem; resize: vertical; outline: none; transition: all 0.3s; }
.custom-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.custom-select { width: 100%; height: 48px; padding: 0 15px; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; outline: none; cursor: pointer; }
.form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }
.pin-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-muted); font-size: 0.9rem; transition: color 0.3s; }
.pin-checkbox input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--gold); }
.pin-checkbox:hover { color: var(--gold); }
.publish-btn { background: var(--primary); color: white; border: none; padding: 12px 30px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3); transition: transform 0.2s; }
.publish-btn:hover { background: #4338ca; transform: translateY(-2px); }

/* --- DUYURU KARTI --- */
.announcement-card { display: flex; gap: 20px; padding: 0; overflow: hidden; position: relative; border: 1px solid var(--border); transition: transform 0.3s ease; }
.pinned-card { border-color: var(--gold); box-shadow: 0 0 15px rgba(251, 191, 36, 0.1); background: linear-gradient(to right, rgba(251, 191, 36, 0.05), transparent); }
.pin-badge { position: absolute; top: 10px; right: 10px; background: var(--gold); color: #000; font-size: 0.75rem; font-weight: bold; padding: 4px 8px; border-radius: 4px; z-index: 2; display: flex; align-items: center; gap: 5px; }
.ann-image { width: 250px; flex-shrink: 0; }
.ann-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-content { padding: 20px; padding-left: 0; flex: 1; display: flex; flex-direction: column; }
.ann-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 10px; padding-right: 20px; }
.ann-header h3 { margin: 0; color: var(--primary); font-size: 1.3rem; }
.ann-date { font-size: 0.8rem; color: var(--text-muted); }
.ann-content p { color: var(--text); line-height: 1.6; font-size: 0.95rem; margin-bottom: 15px; }
.ann-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-right: 20px; }
.duration-badge { font-size: 0.8rem; background: var(--input-bg); padding: 4px 8px; border-radius: 4px; color: var(--text-muted); border: 1px solid var(--border); }
.delete-ann-btn { color: #ef4444; text-decoration: none; font-size: 1.1rem; transition: transform 0.2s; }
.delete-ann-btn:hover { transform: scale(1.2); }
.alert-box { padding: 15px; border-radius: 8px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.alert-box.error { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }

@media (max-width: 768px) {
    .announcement-card { flex-direction: column; }
    .ann-image { width: 100%; height: 200px; }
    .ann-content { padding: 20px; }
    .ann-header { padding-right: 0; }
    .ann-footer { padding-right: 0; }
    .form-footer { flex-direction: column; gap: 15px; }
    .publish-btn { width: 100%; justify-content: center; }
}

/* =========================================
   1. LAYOUT & REKLAM DÜZENİ (FIX)
   ========================================= */
.layout-wrapper { display: flex; gap: 30px; width: 100%; max-width: 1200px; margin: 0 auto; position: relative; padding-top: 20px; }
.main-content { flex: 1; min-width: 0; }
.ad-sidebar { width: 160px; flex-shrink: 0; padding-top: 80px; }
.ad-placeholder-rect { width: 100%; height: 600px; background: rgba(255, 255, 255, 0.05); border: 2px dashed var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-muted); font-size: 0.8rem; position: sticky; top: 20px; }
.ad-mobile { margin-top: 30px; display: flex; justify-content: center; width: 100%; }
.ad-placeholder-square { width: 300px; height: 250px; background: rgba(255, 255, 255, 0.05); border: 2px dashed var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

@media (max-width: 992px) {
    .ad-sidebar { display: none !important; }
    .layout-wrapper { display: block; padding-top: 0; }
    .main-content { width: 100%; }
}
@media (min-width: 993px) {
    .ad-mobile { display: none !important; }
}

/* =========================================
   2. PROFİL MENÜSÜ & DROPDOWN (KESİN FIX)
   ========================================= */
.profile-container { 
    position: relative; 
    display: inline-block; 
    height: 40px; 
    margin-left: 0;  /* DİKKAT: Bunu 'auto' yaparsan sağa gider, '0' yaparsan sola gelir. */
    flex-shrink: 0;  /* Profil resmi asla yamulmaz/büzüşmez */
}
.profile-trigger { padding: 0; border: none; background: none; display: block; height: 100%; cursor: pointer; }
.profile-dropdown {
    display: none; /* Önemli: Gizli Başlar */
    position: absolute;
    top: 100%;
    right: 0;
    width: 260px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 2000;
    margin-top: 10px;
    overflow: hidden;
    text-align: left;
}
.profile-container:hover .profile-dropdown { display: block; animation: fadeIn 0.2s ease; }
.profile-container::after { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 15px; background: transparent; }

/* İçerik Stilleri */
.dropdown-header { padding: 20px; text-align: center; background: rgba(79, 70, 229, 0.05); border-bottom: 1px solid var(--border); }
.dropdown-stats { display: flex; padding: 15px; border-bottom: 1px solid var(--border); }
.stat-item { flex: 1; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-val { display: block; font-weight: bold; font-size: 1.1rem; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }
.dropdown-footer { padding: 10px; }
.dropdown-link { display: flex; align-items: center; gap: 10px; padding: 10px; color: var(--text); text-decoration: none; border-radius: 6px; font-size: 0.9rem; transition: background 0.2s; }
.dropdown-link:hover { background: var(--input-bg); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   3. CROP MODAL (RESİM KIRPMA POPUP)
   ========================================= */
.crop-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; justify-content: center; align-items: center; }
.crop-content { background: var(--card-bg); padding: 20px; border-radius: 12px; max-width: 500px; width: 90%; text-align: center; border: 1px solid var(--border); }
.crop-image-container { max-height: 400px; overflow: hidden; margin-bottom: 20px; background: #000; }
.crop-image-container img { max-width: 100%; display: block; }
.crop-actions { display: flex; gap: 10px; justify-content: center; }
/* --- MOBİL ALT MENÜ DÜZENİ (FİX) --- */
.mobile-nav {
    display: none; /* Masaüstünde gizle */
}

@media (max-width: 768px) {
    /* Menü Çubuğu */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: var(--card-bg); /* Kart rengiyle aynı olsun */
        border-top: 1px solid var(--border);
        justify-content: space-around; /* Eşit aralıkla diz */
        align-items: center;
        z-index: 9999; /* En üstte dur */
        backdrop-filter: blur(10px); /* Hafif buzlu cam efekti */
        padding-bottom: 5px; /* Alt kısımdan hafif boşluk */
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    }

    /* Menü Elemanları */
    .mobile-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        gap: 5px;
        width: 100%;
        height: 100%;
        background: none;
        border: none;
        cursor: pointer;
    }

    /* İkonlar */
    .mobile-nav .nav-item i {
        font-size: 1.4rem;
        transition: transform 0.2s, color 0.2s;
    }

    /* Aktif Sayfa Rengi */
    .mobile-nav .nav-item.active {
        color: var(--primary); /* Mor renk */
    }

    .mobile-nav .nav-item.active i {
        transform: translateY(-3px); /* Hafif yukarı zıplasın */
        text-shadow: 0 0 10px var(--primary-glow);
    }

    /* İçeriğin altta kalmasını önlemek için boşluk bırak */
    .main-container {
        padding-bottom: 90px !important;
    }
    
    /* Masaüstü Navbar'ı mobilde gizle (Çakışmayı önler) */
    .nav-bar {
        display: none !important;
    }
}
/* --- MOBİL MENÜ ANİMASYONU --- */
@media (max-width: 768px) {
    /* Sidebar Varsayılan Hali (Gizli) */
    #sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Ekranın solunda saklı */
        height: 100vh;
        width: 260px;
        z-index: 10000; /* En üstte */
        transition: left 0.3s ease; /* Kayma efekti */
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    /* .active sınıfı eklenince (Görünür) */
    #sidebar.active {
        left: 0; /* İçeri gir */
    }

    /* Karartma Perdesi */
    .overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.7);
        z-index: 9998; /* Sidebar'ın hemen altında */
        backdrop-filter: blur(3px);
    }
    
    .overlay.active {
        display: block; /* Aktifken görün */
    }
}