/**
 * MetisCari İş Ortaklığı Paneli
 * Özel Stil Dosyası
 * Renk Teması: Anadolu / Ticaret / Gelenek + Modern / Toprak & Güven
 */

:root {
    /* Ana Renkler */
    --primary: #8D6E63;
    --secondary: #A1887F;
    --background: #F6F3F1;
    --card: #FFFFFF;
    --text: #3E2723;
    --accent: #C8B6A6;
    
    /* Bootstrap override */
    --bs-primary: #8D6E63;
    --bs-primary-rgb: 141, 110, 99;
    --bs-secondary: #A1887F;
    --bs-secondary-rgb: 161, 136, 127;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}

/* Genel Stiller */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
}

/* Bootstrap Primary Renk Override */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #7A5E54;
    border-color: #7A5E54;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

/* Card Stiller */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: var(--card);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    font-weight: 600;
}

/* Sidebar Stiller */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, #7A5E54 100%);
    color: white;
    transition: all 0.3s;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo:hover {
    color: var(--accent);
}

.sidebar-menu {
    padding: var(--spacing-md) 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu-item {
    margin-bottom: 0.25rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.875rem var(--spacing-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.75rem;
}

.sidebar-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid var(--accent);
}

.sidebar-menu-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Sidebar Menu Divider */
.sidebar-menu-divider {
    padding: 20px 20px 10px 20px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu-divider span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.content-wrapper {
    padding: var(--spacing-lg);
}

/* Navbar (Top Bar) */
.top-navbar {
    background-color: var(--card);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

/* Form Stiller */
.form-control,
.form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(141, 110, 99, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Button Stiller */
.btn {
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: #8F7A6F;
    border-color: #8F7A6F;
}

/* Table Stiller */
.table {
    background-color: var(--card);
}

.table thead th {
    background-color: var(--background);
    color: var(--text);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: rgba(141, 110, 99, 0.05);
}

/* Badge Stiller */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

/* Alert Stiller */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Modal Stiller */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background-color: var(--primary);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Modal Düzeltmeleri - Basit Yaklaşım */
.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    margin: 1.75rem auto;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal içindeki HERŞEY statik */
.modal,
.modal *,
.modal *:hover,
.modal *:focus {
    transition: none !important;
}

/* Sadece butonlara transition izni */
.modal .btn,
.modal .btn:hover {
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out !important;
}

/* Giriş Sayfası Stiller */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-card {
    max-width: 450px;
    width: 100%;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-logo p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Responsive - Tablet */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
}

/* Responsive - Mobil */
@media (max-width: 575.98px) {
    .content-wrapper {
        padding: var(--spacing-sm);
    }
    
    .top-navbar {
        padding: 0.75rem var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .card {
        margin-bottom: var(--spacing-sm);
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Mobil için card layout */
    .mobile-card-view {
        display: block !important;
    }
    
    .desktop-table-view {
        display: none !important;
    }
}

/* Mobil Card View */
.mobile-card-view {
    display: none;
}

.mobile-card-item {
    background-color: var(--card);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-card-title {
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.mobile-card-body {
    font-size: 0.9rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    color: #6c757d;
    font-weight: 500;
}

.mobile-card-value {
    color: var(--text);
    text-align: right;
}

/* Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* Scrollbar Stiller */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Utility Classes */
.text-accent {
    color: var(--accent) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

.shadow-sm-custom {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.shadow-custom {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.rounded-custom {
    border-radius: 8px !important;
}

/* Modal açıkken TÜM hover efektlerini devre dışı bırak */
body.modal-is-open * {
    pointer-events: none !important;
}

body.modal-is-open .modal,
body.modal-is-open .modal * {
    pointer-events: auto !important;
}

/* Print Stiller */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}