:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --accent-color: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    min-height: 100vh;
    width: 100%;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    background-color: #000; /* Varsayılan siyah */
}

/* Duvar kağıdı sınıfı PHP tarafından dinamik basılacak olsa da temel stil burada */
.has-wallpaper {
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-size: 100% 100% !important;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 0;
}


/* Legacy tasarımdan kalan ve AdminLTE ile çakışan manuel .container ve sağ .sidebar kuralları temizlenmiştir. */

.search-wrapper {
    width: 100%;
    max-width: 600px;
    perspective: 1000px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 15px 8px 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 1.1rem;
    padding: 10px 0;
    font-weight: 300;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.search-button:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.search-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.time-display {
    grid-column: 1 / -1;
    color: var(--text-color);
    text-align: left;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 20px;
}

#clock {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -2px;
}

#date {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.8;
    margin-top: -10px;
}


/* Manuel navbar kuralları silindi (AdminLTE ile çakışıyordu) */

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.nav-link:hover {
    opacity: 1;
    color: var(--accent-color);
}

.login-container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    text-align: center;
}

.login-card h2 {
    color: white;
    margin-bottom: 25px;
    font-weight: 300;
}

.login-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    margin-bottom: 15px;
    outline: none;
    box-sizing: border-box;
}

.login-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.error-msg {
    color: #ff4b4b;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

/* ALT NAVBAR (FOOTER) */
.footer-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: calc(100% - 220px); /* Sidebar genişliği çıkarıldı */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.admin-link {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.text-danger {
    color: #ff4b4b !important;
}

.text-danger:hover {
    color: #ff7676 !important;
}

/* MOBİL ALT MENÜ (TAB BAR) - Varsayılan Gizli */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 2000;
    display: none; /* Mobilde açılacak */
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
    transition: 0.3s;
    cursor: pointer;
}

.nav-btn:hover, .nav-btn:active {
    opacity: 1;
    color: var(--accent-color);
}

.nav-icon { font-size: 1.4rem; }
.nav-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }


/* --- MOBILE RESPONSIVE OPTIMIZATION --- */
html, body {
    overflow-x: hidden !important;
}

@media (max-width: 768px) {
    html, body {
        background-attachment: scroll !important; /* Performans için mobilde fixed kapatıldı */
    }
    .content-wrapper {
        padding: 5px !important; /* Daha sıkı alan */
    }
    /* Performans için mobilde blur efektlerini sınırla */
    .card, .small-box, .info-box, .bookmark-item-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.7) !important; /* Daha koyu ama opak arka plan */
    }
    .main-header {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        margin: 0 !important; /* Sidebar marjinini mobilde sıfırla */
        height: 57px !important;
        z-index: 9999 !important;
        background: #0f172a !important; /* Tam opak koyu arka plan */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .main-header .nav-link {
        color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .main-header .nav-link i {
        font-size: 1.3rem !important; /* Hamburger ikonunu daha da büyüt */
        color: #ffffff !important;
    }
    .main-sidebar {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(15, 23, 42, 1) !important;
        will-change: transform; /* Performans optimizasyonu */
    }

    .dashboard-clock-container #clock {
        font-size: 2.5rem !important; /* Biraz daha küçült */
    }
    .dashboard-clock-container #date {
        font-size: 0.9rem !important;
    }
    .search-wrapper {
        max-width: 95% !important;
    }
    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important; /* Daha esnek grid */
        gap: 8px !important;
    }
    .bookmark-item-card {
        padding: 8px !important;
    }
    .bookmark-item-card span, .info-box-number {
        font-size: 0.8rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        width: 100%;
    }
    .bookmark-icon-lg {
        width: 28px !important;
        height: 28px !important;
    }
}

/* --- ADMINLTE GLASSMORPHISM OVERRIDES --- */

/* Global main-header ayarları (Mobil harici) */
@media (min-width: 769px) {
    .main-header {
        background: rgba(0, 0, 0, 0.45) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}

.main-sidebar {
    background: #0f172a !important; /* Tam opak koyu lacivert/siyah */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: transparent !important;
}

.content-wrapper {
    background: transparent !important;
}

.card {
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
    border-radius: 12px !important;
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.small-box {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
    border-radius: 12px !important;
}

.small-box .inner h3, .small-box .inner p {
    color: #fff !important;
}

.small-box-footer {
    background: rgba(0,0,0,0.2) !important;
}

/* Sidebar Nav Customization */
.nav-sidebar .nav-link {
    color: rgba(255,255,255,0.7) !important;
    border-radius: 8px !important;
    margin-bottom: 3px;
}
.nav-sidebar .nav-link:hover, .nav-sidebar .nav-link.active {
    background: rgba(59, 130, 246, 0.3) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.nav-header {
    background: transparent !important;
    color: rgba(255,255,255,0.4) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* Modal and Dropdown Overrides */
.dropdown-menu {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
}
.dropdown-item {
    color: rgba(255,255,255,0.8);
}
.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Dashboard Grid Adjustments */
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.bookmark-item-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255,255,255,0.04) !important;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    color: inherit;
}
.bookmark-item-card:hover {
    transform: translateY(-8px);
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.bookmark-icon-lg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 10px;
    object-fit: contain;
}

/* Clock style for Content Area */
.dashboard-clock-container {
    text-align: center;
    padding: 2rem 0;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: rgba(255, 255, 255, 0.95);
}
.dashboard-clock-container #clock {
    font-size: 5rem;
    font-weight: 700;
}
.dashboard-clock-container #date {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* Kategoriler altındaki grid başlıkları için taşma ayarı */
.card-body .bookmarks-grid .bookmark-item-card .text-truncate {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kategori kartları için scroll bar ayarları */
.scroll-card-body {
    max-height: 300px; /* Yaklaşık 5 satır bookmark için */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) transparent;
}

.scroll-card-body::-webkit-scrollbar {
    width: 6px;
}

.scroll-card-body::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-card-body::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
    border-radius: 10px;
}

.scroll-card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* Mobil Sidebar Navigasyon İyileştirmeleri */
.main-sidebar .d-md-none .nav-link {
    font-size: 1rem !important;
    padding: 12px 15px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.main-sidebar .d-md-none .nav-header {
    letter-spacing: 2px;
    font-weight: 700 !important;
    color: #3b82f6 !important; /* Mavi vurgu */
    padding-left: 15px !important;
}

.main-sidebar .d-md-none .nav-link i {
    width: 25px;
    text-align: center;
    color: #3b82f6 !important;
}

/* Favori Linkler: Sadece İkon Görünümü */
.favorites-only-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.favorite-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.favorite-icon-card:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.favorite-icon-card .bookmark-icon-lg {
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
}

@media (max-width: 768px) {
    .favorites-only-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
        gap: 10px;
    }
    .favorite-icon-card {
        padding: 10px;
    }
    .favorite-icon-card .bookmark-icon-lg {
        width: 32px !important;
        height: 32px !important;
    }
}
