@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* --- RENK TANIMLAMALARI (VARIABLES) --- */
:root {
    /* Varsayılan (Aydınlık) Renkler */
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    
    --bg-body: #f4f6f9;       /* Arka plan rengi */
    --bg-card: #ffffff;       /* Kutu/Kart rengi */
    --text-main: #2d3436;     /* Ana yazı rengi */
    --text-muted: #666666;    /* Soluk yazı rengi */
    --border-color: #eeeeee;  /* Çizgi rengi */
    --input-bg: #ffffff;      /* Input arka planı */
    
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* --- KARANLIK MOD AYARLARI --- */
html.dark-mode body {
    /* Karanlık Modda Değişecek Renkler */
    --bg-body: #121212;       /* Simsiyah arka plan */
    --bg-card: #1e1e1e;       /* Koyu gri kutular */
    --text-main: #e0e0e0;     /* Açık gri yazı */
    --text-muted: #a0a0a0;    /* Daha açık soluk yazı */
    --border-color: #333333;  /* Koyu çizgiler */
    --input-bg: #2c2c2c;      /* Koyu input */
    
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --- GENEL AYARLAR --- */
body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-body); /* Değişken kullanıyoruz */
    color: var(--text-main);          /* Değişken kullanıyoruz */
    margin: 0; 
    line-height: 1.6; 
    transition: background-color 0.3s, color 0.3s; /* Renk geçişi yumuşak olsun */
}

h1, h2, h3, h4, h5, h6 { color: var(--text-main) !important; }
p { color: var(--text-muted); }
hr { border: 0; border-top: 1px solid var(--border-color); }

/* --- NAVBAR --- */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 15px 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.3);
    position: relative;
    z-index: 1000;
}
/* Navbar Karanlık Modda biraz daha koyulaşsın */
body.dark-mode .navbar {
    background: linear-gradient(135deg, #000000, #434343);
}

.navbar a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: 0.3s;
    white-space: nowrap; 
    display: inline-flex; 
    align-items: center;
}
.navbar a:hover { color: white; transform: translateY(-2px); }

/* --- DROPDOWN (AÇILIR MENÜ) --- */
.dropdown { position: relative; display: inline-block; margin-left: 20px;}
.dropbtn { 
    color: white; 
    font-weight: 600; 
    cursor: pointer; 
    padding: 8px 12px; 
    display: flex; 
    align-items: center; 
    border-radius: 5px; 
    white-space: nowrap;
    background: rgba(255,255,255,0.1);
}
.dropbtn:hover { background-color: rgba(255,255,255,0.2); }

.dropdown-content {
    display: none; position: absolute; right: 0; top: 100%;
    background-color: var(--bg-card); /* Kutu rengi değişkenden */
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15); border-radius: 8px; overflow: hidden; z-index: 9999; margin-top: 5px;
    border: 1px solid var(--border-color);
}
.dropdown-content a { color: var(--text-main) !important; padding: 12px 16px; display: block; border-bottom: 1px solid var(--border-color); margin-left: 0; text-align: left;}
.dropdown-content a:hover { background-color: var(--bg-body); color: var(--primary-color) !important; }
.dropdown:hover .dropdown-content { display: block; }

/* --- ANA DÜZEN --- */
.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }

/* Giriş/İletişim Yapısı */
.split-wrapper { 
    display: grid; 
    grid-template-columns: 350px 1fr;
    background: var(--bg-card); /* Beyaz yerine değişken */
    border-radius: 20px;
    overflow: hidden; 
    box-shadow: var(--shadow);
    min-height: 500px;
    border: 1px solid var(--border-color); /* Karanlık modda sınır belli olsun */
}

/* Ana Sayfa Yapısı */
.layout-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

/* --- SOL TARAFTAKİ RENKLİ ALAN --- */
.sidebar-gradient { 
    background: linear-gradient(135deg, #4e54c8, #8f94fb) !important; 
    color: white !important;
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    padding: 40px; text-align: center; height: 100%; box-sizing: border-box;
}
body.dark-mode .sidebar-gradient {
    background: linear-gradient(135deg, #1a1a1a, #333) !important; /* Karanlık modda burası da koyulaşsın */
}
.sidebar-gradient i { color: white !important; margin-bottom: 20px; filter: drop-shadow(0 0 5px rgba(0,0,0,0.2)); }
.sidebar-gradient h2 { color: white !important; margin: 0 0 10px 0; }
.sidebar-gradient p { color: rgba(255,255,255,0.9) !important; }

/* --- KUTULAR VE KARTLAR --- */
.sidebar-panel { 
    background: var(--bg-card); /* Değişken */
    border-radius: 15px; 
    box-shadow: var(--shadow); 
    padding: 30px; 
    text-align: center; 
    border-top: 5px solid var(--primary-color);
    border: 1px solid var(--border-color);
}

.content-panel { padding: 40px; background: var(--bg-card); color: var(--text-main); }

.card { 
    background: var(--bg-card); /* Değişken */
    border-radius: 15px; 
    padding: 25px; 
    margin-bottom: 25px; 
    box-shadow: var(--shadow); 
    border: 1px solid var(--border-color);
    transition: 0.3s;
}
.card:hover { transform: translateY(-3px); border-color: var(--primary-color); }
.grid-projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* --- FORMLAR --- */
input, textarea { 
    width: 100%; padding: 15px; margin: 10px 0 20px 0; 
    border: 2px solid var(--border-color); /* Değişken */
    border-radius: 10px; box-sizing: border-box; font-family: 'Poppins', sans-serif;
    background-color: var(--input-bg); /* Değişken */
    color: var(--text-main); /* Değişken */
}
input:focus, textarea:focus { border-color: var(--secondary-color); outline: none; }

/* --- BUTONLAR --- */
.btn { 
    display: inline-block; padding: 12px 30px; border-radius: 50px; 
    text-decoration: none; color: rgb(4, 4, 4); border: none; cursor: pointer; 
    text-align: center; font-weight: 600; transition: 0.3s; font-size: 0.95em;
    box-shadow: 0 5px 15px rgba(78, 84, 200, 0.3);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(78, 84, 200, 0.4); }
.btn-blue { background: linear-gradient(45deg, #4e54c8, #8f94fb); }
.btn-green { background: linear-gradient(45deg, #11998e, #38ef7d); }

/* --- MODAL --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 10000; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-box {
    background: var(--bg-card); /* Değişken */
    padding: 30px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    position: relative;
    color: var(--text-main);
}
.modal-box h3 { color: var(--text-main); }
.modal-box p { color: var(--text-muted); }

/* --- DİĞERLERİ --- */
.profile-img-large { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid var(--primary-color); margin-bottom: 20px; }
.message-box { padding: 15px; margin-bottom: 20px; border-radius: 10px; display: flex; align-items: center; font-size: 0.9em; }
.msg-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.msg-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- FOOTER --- */
.site-footer {
    background-color: #2d3436; color: #dfe6e9; padding: 40px 0; margin-top: 60px;
    border-top: 4px solid var(--primary-color); text-align: center; font-size: 0.95em;
}
body.dark-mode .site-footer { background-color: #000; border-color: #333; }
.ai-badge {
    margin-top: 15px; display: inline-block; background: rgba(255, 255, 255, 0.05);
    padding: 8px 20px; border-radius: 50px; font-size: 0.9em; color: #a4b0be;
    transition: 0.3s; border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- ANİMASYONLAR --- */
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
body { animation: pageLoad 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pageLoad { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
body.fade-out { opacity: 0; transform: translateY(-5px); transition: all 0.2s ease-in-out; }

/* --- MOBİL --- */
@media (max-width: 900px) { 
    .split-wrapper { grid-template-columns: 1fr; height: auto;} 
    .layout-grid { grid-template-columns: 1fr; }
    .navbar { flex-direction: column; text-align: center; padding: 20px; }
    .navbar div { margin-bottom: 10px; width: 100%; justify-content: center;}
    .sidebar-gradient { border-radius: 20px 20px 0 0; min-height: 200px; }
}

/* --- NAVBAR MİNİ AVATAR --- */
.nav-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%; /* Yuvarlak yap */
    object-fit: cover;
    vertical-align: middle;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.5); /* Hafif beyaz çerçeve */
}

/* --- PROJE DETAY SAYFASI RESİM AYARI --- */
.project-detail-img {
    width: 100%;           /* Genişlik kutuya sığsın */
    max-height: 400px;     /* Çok uzamasın */
    object-fit: cover;     /* Resmi ezmeden kırp */
    border-radius: 10px;   /* Köşeleri yuvarla */
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* --- GİRİŞ VE KAYIT KARTI TASARIMI (PC İÇİN) --- */
.auth-card {
    display: flex;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden; /* Köşelerin yuvarlak kalması için */
    max-width: 900px; /* PC'de çok yayılmasın */
    margin: 50px auto;
    min-height: 500px;
}

.auth-visual {
    width: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 40px;
    text-align: center;
}

.auth-form-side {
    width: 50%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mobilde Alt Alta Dursun */
@media (max-width: 768px) {
    .auth-card { flex-direction: column; }
    .auth-visual, .auth-form-side { width: 100%; padding: 30px; }
    .auth-visual { min-height: 200px; }
}

/* --- MODERN TOAST BİLDİRİMİ --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 15px 25px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    animation: slideIn 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
    /* 3 saniye ekranda kalır, sonra kaybolur */
}

.toast i { font-size: 1.5em; color: var(--primary-color); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; display: none; }
}

/* --- SADECE PROJE DETAY SAYFASI DÜZELTMESİ --- */
.project-detail-img {
    width: 100%;           /* Bulunduğu kutuya tam sığsın */
    max-width: 100%;       /* Asla taşmasın */
    height: auto;          /* Orantısı bozulmasın (basık görünmesin) */
    object-fit: contain;   /* Resmi kutuya sığdırır */
    border-radius: 10px;   /* Köşeleri yumuşat */
    border: 1px solid var(--border-color); /* İnce çerçeve */
    background: var(--bg-body); /* Resim şeffafsa arkası düzgün dursun */
    display: block;
}

/* --- SAYFA GEÇİŞ ANİMASYONU --- */
body {
    opacity: 0; /* Sayfa ilk açılışta gizli başlar */
    transition: opacity 0.3s ease-in-out;
}

body.fade-in {
    opacity: 1; /* Yüklenince görünür olur */
}

body.fade-out {
    opacity: 0; /* Sayfadan çıkarken kaybolur */
}

/* --- SÜRÜM SEÇİM EKRANI --- */
.version-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.ver-card {
    flex: 1;
    min-width: 250px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.ver-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.ver-card i { font-size: 3em; margin-bottom: 10px; display: block; }
.ver-card h3 { margin: 10px 0 5px 0; color: #333; }
.ver-card p { margin: 0; color: #777; font-weight: bold; }

/* Flagship (Modern) */
.ver-card.flagship { border-color: var(--primary-color); background: #f0f4ff; }
.ver-card.flagship i { color: var(--primary-color); }
.ver-card.flagship .badge {
    position: absolute; top: 0; right: 0; background: var(--primary-color);
    color: white; padding: 5px 10px; font-size: 0.7em;
    border-bottom-left-radius: 10px;
}

/* Classic (Vista/7) */
.ver-card.classic { border-color: #3498db; background: #eaf6ff; }
.ver-card.classic i { color: #3498db; }

/* Retro (XP/Longhorn) */
.ver-card.retro { border-color: #e67e22; background: #fff6e6; }
.ver-card.retro i { color: #e67e22; }

/* Mobilde alt alta olsun */
@media (max-width: 768px) {
    .version-grid { flex-direction: column; }
}

/* --- MODAL DÜZELTMELERİ --- */

/* 1. KUTU KAYDIRMA SORUNU ÇÖZÜMÜ */
.modal-overlay {
    /* Pencere sığmazsa aşağı kaydırmaya izin ver */
    overflow-y: auto !important; 
    align-items: flex-start !important; /* Ortalamayı boz, yukarıdan başlat */
    padding-top: 50px; /* Yukarıya yapışmasın */
    padding-bottom: 50px; /* Aşağıya yapışmasın */
}

.modal-box {
    margin: 0 auto; /* Ortala */
    width: 90%;
    max-width: 1000px; /* Kutuyu biraz daha genişletelim ki 3'ü sığsın */
}

/* 2. DEVASA KART SORUNU ÇÖZÜMÜ */
.ver-card {
    flex: 1;
    min-width: 250px;
    
    /* İŞTE SİHİRLİ KOD: Kartlar asla 320px'den geniş olmasın */
    max-width: 320px; 
    
    /* Eğer alt satıra geçerse ortada dursun, sola yayılmasın */
    margin: 10px auto; 
}

/* Kartların hizalamasını güzelleştir */
.version-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center; /* Kartları her zaman ortala */
}

/* --- İNDİR BUTONU ORTALAMA DÜZELTMESİ --- */
.ver-card .btn {
    text-align: center !important;      /* Metni zorla ortala */
    display: flex !important;           /* Esnek kutu modeli */
    justify-content: center !important; /* Yatayda tam orta */
    align-items: center !important;     /* Dikeyde tam orta */
    width: 100%;                        /* Genişliği tam kapla */
    box-sizing: border-box;             /* Padding taşmalarını engelle */
    margin-top: auto;                   /* Butonu kartın en altına it (opsiyonel şıklık) */
}

/* --- PROJE KARTLARI VE IZGARA YAPISI --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Yan yana dizme komutu */
    gap: 30px; /* Kartlar arası boşluk */
    padding: 20px 0;
}

.project-card {
    background: var(--bg-body); /* Kart arka planı */
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* Silme butonu için gerekli */
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px); /* Üzerine gelince yukarı zıplama */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover; /* Resmi kutuya sığdır */
    border-bottom: 1px solid var(--border-color);
}

.p-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.p-content h3 {
    margin: 0 0 10px;
    font-size: 1.4em;
    color: var(--text-main);
}

.p-content p {
    color: var(--text-muted);
    font-size: 0.95em;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* BUTON DÜZELTMESİ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

.btn-blue {
    background-color: var(--primary-color);
    color: #fff;
    margin-top: auto; /* Butonu en alta it */
}

.btn-blue:hover {
    opacity: 0.9;
}

/* --- BİLDİRİM LİSTESİ TASARIMI --- */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.notif-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.notif-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    margin-right: 15px;
    flex-shrink: 0;
}

.notif-content {
    flex-grow: 1;
}

.notif-text {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

.notif-time {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
}

.notif-badge {
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-left: 10px;
}