/* GLOBAL SIFIRLAMA VE DEĞİŞKENLER */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--neu-bg); }

:root {
    --text-primary: #44476a;
    --text-secondary: #7a7d9c;

    /* Neumorphism (Yumuşak Arayüz) Renkleri */
    --neu-bg: #e0e5ec;
    --neu-text: #44476a;
    --neu-primary: #1e293b;
    --neu-error: #f44336;
    --neu-shadow-light: #ffffff;
    --neu-shadow-dark: #b8bec9;
}

/* -------------------------------------------
   GİRİŞ EKRANI (Z-Index Yüksek)
------------------------------------------- */
#login-screen {
    background-color: var(--neu-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    z-index: 9999 !important;
}

/* Giriş Formu Kartı */
.neu-container { width: 100%; max-width: 450px; padding: 30px; }
.neu-form-card {
    background: var(--neu-bg);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 12px 12px 24px var(--neu-shadow-dark), -12px -12px 24px var(--neu-shadow-light);
}
.neu-logo { font-size: 3rem; color: var(--neu-primary); margin-bottom: 15px; display: flex; justify-content: center; }
.neu-title { font-size: 1.8rem; font-weight: 700; color: var(--neu-text); text-align: center; margin-bottom: 5px; }
.neu-subtitle { color: #7a7d9c; text-align: center; font-size: 0.95rem; margin-bottom: 35px; }

/* Form Elemanları */
.neu-input-group { position: relative; margin-bottom: 25px; }
.neu-input {
    width: 100%; padding: 16px 20px 16px 50px; border: none; border-radius: 15px;
    background: var(--neu-bg); color: var(--neu-text); font-size: 1rem;
    box-shadow: inset 5px 5px 10px var(--neu-shadow-dark), inset -5px -5px 10px var(--neu-shadow-light);
    transition: all 0.3s ease; outline: none;
}
.neu-input:focus { box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light); }
.neu-input:focus + .neu-icon { color: var(--neu-primary); }
.neu-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #7a7d9c; font-size: 1.1rem; pointer-events: none; }

.neu-btn {
    background: var(--neu-bg); color: var(--neu-primary); border: none; border-radius: 15px;
    padding: 18px 40px; font-size: 1.1rem; font-weight: 700; cursor: pointer;
    transition: all 0.3s ease; width: 100%; display: flex; justify-content: center; align-items: center;
    box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
}
.neu-btn:hover { color: #000; transform: translateY(-2px); }
.neu-btn:active { box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light); transform: translateY(0); }
.neu-footer { margin-top: 25px; text-align: center; font-size: 0.8rem; color: #7a7d9c; opacity: 0.6; }

/* -------------------------------------------
   YAN MENÜ (SIDEBAR) & YERLEŞİM - HOVER İLE AÇILAN VERSİYON
------------------------------------------- */
.sidebar {
    width: 60px; /* Daraltılmış genişlik */
    background: var(--neu-bg);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    box-shadow: 6px 0 12px var(--neu-shadow-dark);
    border-right: none;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: width 0.3s ease, box-shadow 0.3s ease; /* Genişlik ve gölge geçişi */
    overflow: hidden; /* Taşmayı gizle */
}

.sidebar:hover {
    width: 260px; /* Genişletilmiş genişlik */
    box-shadow: 6px 0 20px rgba(0,0,0,0.15); /* Açıldığında daha belirgin gölge */
}

/* LOGO ALANI */
.logo-area {
    padding: 15px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    min-height: 100px;
}

/* DİKEY ENVIROLAB YAZISI (Kapalı Modda) */
.brand-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.4s ease;
    position: relative;
}

.sidebar:hover .brand-vertical {
    opacity: 0;
    pointer-events: none;
}

.brand-letter {
    font-size: 13px;
    font-weight: 700;
    color: var(--neu-text);
    letter-spacing: 0.5px;
    line-height: 1.3;
    position: relative;
    animation: softGlow 6s ease-in-out infinite;
}

/* Her harf için farklı animasyon gecikmesi - daha yavaş */
.brand-letter:nth-child(1) { animation-delay: 0s; }
.brand-letter:nth-child(2) { animation-delay: 0.3s; }
.brand-letter:nth-child(3) { animation-delay: 0.6s; }
.brand-letter:nth-child(4) { animation-delay: 0.9s; }
.brand-letter:nth-child(5) { animation-delay: 1.2s; }
.brand-letter:nth-child(6) { animation-delay: 1.5s; }
.brand-letter:nth-child(7) { animation-delay: 1.8s; }
.brand-letter:nth-child(8) { animation-delay: 2.1s; }
.brand-letter:nth-child(9) { animation-delay: 2.4s; }

/* Soft Işık Dalgası Animasyonu - Çok yavaş ve yumuşak */
@keyframes softGlow {
    0%, 100% {
        text-shadow: 0 0 2px rgba(59, 130, 246, 0.1);
        color: var(--neu-text);
        opacity: 0.7;
    }
    50% {
        text-shadow: 
            0 0 8px rgba(59, 130, 246, 0.3),
            0 0 12px rgba(59, 130, 246, 0.2);
        color: #6b9fdb;
        opacity: 1;
    }
}

/* GENİŞLETİLMİŞ LOGO (Hover Modda) */
.brand-expanded {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
    padding: 0 1.5rem;
}

.sidebar:hover .brand-expanded {
    opacity: 1;
}

/* ENVIROLAB YAZISI (Genişletilmiş Durumda) */
.brand-main {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-align: left;
    color: var(--neu-text);
    white-space: nowrap;
    margin-bottom: 0.2rem;
}

.brand-sub {
    font-size: 10px;
    color: #7a7d9c;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.brand-sub .arrow {
    color: #3b82f6;
    font-weight: 700;
}

.action-area {
    padding: 0;
    border-bottom: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

.sidebar:hover .action-area {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    max-height: 70px;
    opacity: 1;
}

/* Yeni Ekle Butonu */
.btn-new-project {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    padding: 8px;
    background: var(--neu-bg); color: var(--neu-text); border-radius: 12px; font-size: 12px; font-weight: 700;
    transition: all 0.2s; cursor: pointer; border: none;
    box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
}

.btn-new-project i {
    margin-right: 8px;
}

.btn-new-project .text-content {
    display: inline;
}

.btn-new-project:hover {
    color: var(--neu-primary);
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
}
.btn-new-project:active {
    box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
    transform: translateY(0);
}

.menu-container {
    flex: 0;
    overflow: hidden;
    padding: 0;
    max-height: 0;
    opacity: 0;
    transition: flex 0.4s ease, max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

.sidebar:hover .menu-container {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
    max-height: 1000px;
    opacity: 1;
}

.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-item { margin-bottom: 12px; }

/* Menü Linkleri */
.menu-link {
    display: flex; align-items: center;
    padding: 12px 14px;
    justify-content: flex-start;
    color: #7a7d9c;
    border-radius: 14px; font-size: 13px; font-weight: 600; transition: all 0.2s; cursor: pointer;
    background: var(--neu-bg);
    border: none;
    white-space: nowrap;
}

.menu-link .text {
    opacity: 1;
    display: inline;
}

.menu-link:hover {
    color: var(--neu-text);
    box-shadow: 5px 5px 10px var(--neu-shadow-dark), -5px -5px 10px var(--neu-shadow-light);
}
.menu-link.active {
    color: var(--neu-primary);
    box-shadow: inset 5px 5px 10px var(--neu-shadow-dark), inset -5px -5px 10px var(--neu-shadow-light);
}
.menu-link.active .icon-wrapper {
    background: transparent;
    color: var(--neu-primary);
    box-shadow: none;
}
.menu-link.active .icon-wrapper i { color: var(--neu-primary) !important; }

.icon-wrapper {
    width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    margin-right: 12px;
    transition: all 0.2s; background: transparent; overflow: hidden;
    flex-shrink: 0;
}

.icon-wrapper img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-footer {
    margin-top: auto;
    padding: 20px 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

.role-badge {
    text-align: center;
    padding: 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--neu-bg);
    color: var(--neu-text);
    box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light);
    white-space: nowrap;
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease;
}

.sidebar:hover .role-badge {
    opacity: 1;
    max-height: 50px;
    padding: 8px;
    margin-bottom: 0;
}

.btn-logout {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--neu-bg);
    color: #dc2626;
    box-shadow: 5px 5px 10px var(--neu-shadow-dark), -5px -5px 10px var(--neu-shadow-light);
    transition: all 0.4s ease;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar:hover .btn-logout {
    width: 100%;
    padding: 12px;
    margin: unset;
    justify-content: flex-start;
}

.btn-logout i {
    margin-right: 0;
    transition: margin-right 0.4s ease;
}

.sidebar:hover .btn-logout i {
    margin-right: 8px;
}

.btn-logout .text-content {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.4s ease 0.2s, width 0.4s ease 0.2s;
}

.sidebar:hover .btn-logout .text-content {
    opacity: 1;
    width: auto;
}

.btn-logout:hover {
    box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light);
}

/* -------------------------------------------
   ANA İÇERİK (MAIN CONTENT)
------------------------------------------- */
.main-content {
    margin-left: 0; /* Sidebar kaldırıldı */
    min-height: 100vh;
    background: var(--neu-bg);
    transition: margin-left 0.3s ease;
}

.sidebar:hover + .main-content {
    margin-left: 0;
}

/* İçerik Kartları */
.content-card {
    background: var(--neu-bg);
    border-radius: 24px;
    padding: 24px;
    border: none;
    box-shadow: 9px 9px 16px var(--neu-shadow-dark), -9px -9px 16px var(--neu-shadow-light);
    transition: all 0.3s ease;
    cursor: pointer; position: relative;
}
.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 12px 12px 20px var(--neu-shadow-dark), -12px -12px 20px var(--neu-shadow-light);
}
.content-card:active {
    transform: translateY(0);
    box-shadow: inset 5px 5px 10px var(--neu-shadow-dark), inset -5px -5px 10px var(--neu-shadow-light);
}

.card-icon-wrapper {
    width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 15px; position: relative; overflow: hidden;
    background: var(--neu-bg);
    box-shadow: inset 5px 5px 10px var(--neu-shadow-dark), inset -5px -5px 10px var(--neu-shadow-light);
}
.card-icon-wrapper img { width: 70%; height: 70%; object-fit: contain; z-index: 2; }
.card-icon-wrapper i { z-index: 2; }

/* Admin Butonları (Düzenle/Sil) */
.admin-controls {
    position: absolute; top: 15px; right: 15px; display: flex; gap: 8px; opacity: 0; transition: all 0.2s; z-index: 10;
}
.content-card:hover .admin-controls { opacity: 1; }

.btn-icon-card {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; transition: transform 0.2s;
    background: var(--neu-bg);
    box-shadow: 3px 3px 6px var(--neu-shadow-dark), -3px -3px 6px var(--neu-shadow-light);
}
.btn-icon-card:hover { transform: scale(1.1); box-shadow: 4px 4px 8px var(--neu-shadow-dark), -4px -4px 8px var(--neu-shadow-light); }
.btn-edit { color: #2563eb; }
.btn-delete { color: #dc2626; }

/* -------------------------------------------
   MODAL VE YARDIMCI STİLLER
------------------------------------------- */
.modal-backdrop { backdrop-filter: blur(10px); animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { animation: slideUp 0.3s ease; border-radius: 32px; overflow: hidden; }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.file-upload-area { border: 2px dashed #cbd5e1; border-radius: 24px; padding: 40px; text-align: center; cursor: pointer; transition: all 0.3s; background: #f8fafc; }
.file-upload-area:hover { border-color: #3b82f6; background: #eff6ff; }
.file-upload-area.has-file { border-color: #10b981; background: #ecfdf5; }

/* Sunucu İkon Izgarası */
.server-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.server-icon-item {
    width: 60px; height: 60px; border-radius: 10px; border: 2px solid transparent;
    cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; background: white;
}
.server-icon-item:hover { border-color: #cbd5e1; transform: scale(1.05); }
.server-icon-item.selected {
    border-color: #3b82f6; background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.server-icon-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Özel Kaydırma Çubuğu */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--neu-bg); }
::-webkit-scrollbar-thumb { background: #b8bec9; border-radius: 4px; }

/* -------------------------------------------
   RESPONSIVE (MOBIL & TABLET UYUMLULUĞU)
------------------------------------------- */
@media (max-width: 1024px) {
    /* Tablet */
    .content-card { padding: 20px; }
}

@media (max-width: 768px) {
    /* Mobil */
    .sidebar {
        width: 60px; /* Mobil ve tabletlerde de başlangıçta dar */
        transform: none; /* Mobil transform'ı geçersiz kıl */
    }
    .sidebar:hover {
        width: 260px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .sidebar:hover + .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-card {
        padding: 16px;
        border-radius: 20px;
    }

    .card-icon-wrapper {
        width: 50px; height: 50px; margin-bottom: 10px;
    }
    .card-icon-wrapper img, .card-icon-wrapper i { font-size: 1.2rem; }

    /* Login Ekranı Mobilde */
    .neu-container { padding: 20px; }
    .neu-form-card { padding: 30px 20px; }
    .neu-logo { font-size: 2.5rem; }
    .neu-title { font-size: 1.5rem; }
}