﻿﻿/* ============================================
   OTORIA ADMIN PANEL - İYİLEŞTİRİLMİŞ SIDEBAR CSS
   ============================================ */

/* Ana Sidebar Stilleri */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    left: 0;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    /* Küçültülmüş Sidebar */
    .sidebar.collapsed {
        width: 70px;
    }

/* Sidebar Header */
.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
    padding: 0.75rem 0.5rem;
    text-align: center;
}

/* Logo Bölümü */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.sidebar.collapsed .logo {
    justify-content: center;
    margin-bottom: 0.75rem;
}

.logo i {
    font-size: 2rem;
    color: #3b82f6;
    min-width: 32px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.logo-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.logo-text span {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Sidebar Küçültme Butonu */
.sidebar-collapse-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    .sidebar-collapse-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }

.sidebar.collapsed .sidebar-collapse-btn {
    right: 50%;
    transform: translateX(50%) rotate(180deg);
}

/* Kullanıcı Bilgileri */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    padding: 0.4rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

    .user-avatar i {
        font-size: 1.2rem;
        color: white;
    }

.user-details {
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar.collapsed .user-details {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.username {
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Navigasyon */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.nav-section {
    margin-bottom: 0.25rem;
}

/* Ana Navigasyon Öğeleri */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    min-height: 40px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.5rem 0.5rem;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-right: 3px solid #3b82f6;
    color: white;
}

.nav-item i {
    width: 20px;
    min-width: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.nav-item.active i {
    color: #3b82f6;
}

.nav-item:hover i {
    color: #e2e8f0;
}

.nav-item span {
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* Küçültülmüş durumdaki text gizleme */
.sidebar.collapsed .nav-item span:not(.expand-icon) {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

/* Tooltip (küçültülmüş durumdaki ipuçları) */
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #334155;
    animation: fadeInTooltip 0.2s ease;
}

.sidebar.collapsed .nav-item:hover::before {
    content: '';
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1e293b;
    z-index: 1001;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Genişletme İkonu */
.expand-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-item.expandable.expanded .expand-icon {
    transform: rotate(180deg);
}

.sidebar.collapsed .expand-icon {
    display: none;
}

/* Alt Menü */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

    .nav-submenu.expanded {
        max-height: 250px;
    }

.sidebar.collapsed .nav-submenu {
    display: none;
}

/* Alt Menü Öğeleri */
.nav-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.4rem 1.5rem 0.4rem 3rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    .nav-subitem:hover {
        background: rgba(255, 255, 255, 0.05);
        color: white;
        text-decoration: none;
    }

    .nav-subitem.active {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
    }

    .nav-subitem i {
        color: #64748b;
        font-size: 0.875rem;
        width: 16px;
        min-width: 16px;
        text-align: center;
    }

    .nav-subitem.active i {
        color: #60a5fa;
    }

.sidebar.collapsed .nav-subitem span {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

/* Ana İçerik Alanı Ayarları */
.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .sidebar.collapsed + .main-content,
    .main-content.sidebar-collapsed {
        margin-left: 70px;
    }

/* Header Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .sidebar-toggle:hover {
        background: rgba(100, 116, 139, 0.1);
        color: #374151;
    }

/* Responsive Tasarım */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    /* Mobilde tooltip'leri gizle */
    .sidebar.collapsed .nav-item:hover::after,
    .sidebar.collapsed .nav-item:hover::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }

        .sidebar.collapsed {
            width: 100%;
            transform: translateX(-100%);
        }
}

/* Scrollbar Stilleri */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }

/* Smooth Animations */
* {
    box-sizing: border-box;
}

.sidebar * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus durumları (erişilebilirlik) */
.nav-item:focus,
.nav-subitem:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* Yükleme animasyonu */
.sidebar.loading {
    pointer-events: none;
}

    .sidebar.loading .nav-item {
        opacity: 0.6;
    }

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-form {
    width: 100%;
}

.logout-btn {
    width: 100%;
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .logout-btn:hover {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
        text-decoration: none;
    }

        .logout-btn:hover i {
            color: #ef4444;
        }

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 0.875rem 0.5rem;
}

    .sidebar.collapsed .logout-btn span {
        opacity: 0;
        visibility: hidden;
        width: 0;
        overflow: hidden;
    }

/* Print medyası için gizle */
@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Loading indicator styles */
#loadingIndicator {
    padding: 2rem;
    text-align: center;
}

#loadingIndicator .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Modal content transition */
#modalContent {
    transition: opacity 0.3s ease-in-out;
}

/* Header Styles */
.main-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 70px;
}

/* Header Sol Taraf */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .sidebar-toggle:hover {
        background: rgba(100, 116, 139, 0.1);
        color: #374151;
    }

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Header Sağ Taraf */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Arama Alanı */
.search-container {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

    .search-form:focus-within {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.search-input {
    border: none;
    background: transparent;
    outline: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    width: 200px;
}

    .search-input::placeholder {
        color: #9ca3af;
    }

.search-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

    .search-btn:hover {
        color: #374151;
    }

/* Kullanıcı Bilgileri */
.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 120px;
}

.header-username {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

.header-user-role {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.2;
}

/* Header Butonları */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-header-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    position: relative;
}

    .btn-header-icon:hover {
        background: #e2e8f0;
        color: #374151;
    }

    .btn-header-icon:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

/* Bildirim Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Dropdown Menü */
.dropdown-menu {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 200px;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .dropdown-item:hover {
        background: #f8fafc;
        color: #1e293b;
    }

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e2e8f0;
}

/* Responsive Tasarım */
@media (max-width: 1024px) {
    .main-header {
        padding: 1rem;
    }

    .search-container {
        display: none;
    }

    .header-user-info {
        display: none;
    }

    .page-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    .header-left {
        gap: 0.5rem;
    }

    .page-title {
        font-size: 1.125rem;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .btn-header-icon {
        width: 36px;
        height: 36px;
    }
}