/* Sonic Pesa - Professional Business Design - FIXED VERSION */

:root {
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --sidebar-width: 260px;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--light-bg);
    font-size: 0.925rem;
    overflow-x: hidden;
}

/* ==================== SIDEBAR STYLES - FIXED ==================== */
#wrapper {
    min-height: 100vh;
    overflow-x: hidden;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    z-index: 1030;
}

/* Desktop - Always visible */
@media (min-width: 769px) {
    #sidebar-wrapper {
        transform: translateX(0);
    }
    
    #page-content-wrapper {
        margin-left: var(--sidebar-width);
    }
}

/* Mobile - Hidden by default */
@media (max-width: 768px) {
    #sidebar-wrapper {
        transform: translateX(-100%);
    }
    
    #wrapper.toggled #sidebar-wrapper {
        transform: translateX(0);
    }
    
    #page-content-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

/* Sidebar overlay on mobile */
@media (max-width: 768px) {
    #wrapper.toggled::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1020;
    }
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.25rem 1.5rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#sidebar-wrapper .list-group-item {
    border: none;
    background-color: transparent;
    color: rgba(255,255,255,0.75);
    padding: 0.875rem 1.5rem;
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: white;
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1.5rem - 3px);
}

#sidebar-wrapper .list-group-item.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: white;
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1.5rem - 3px);
}

#sidebar-wrapper .list-group-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.1);
    margin: 1rem 1.5rem;
}

/* ==================== PAGE CONTENT ==================== */
#page-content-wrapper {
    width: 100%;
    min-height: 100vh;
    background-color: var(--light-bg);
    transition: margin-left 0.3s ease;
}

/* ==================== TOP NAVBAR ==================== */
.navbar-light {
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

#sidebarToggle {
    background: none;
    border: none;
    color: var(--dark-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
}

#sidebarToggle:hover {
    color: var(--primary-color);
}

/* ==================== AVATAR ==================== */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: #374151;
}

.card-body {
    padding: 1.5rem;
}

/* ==================== STAT CARDS ==================== */
.stat-card {
    border-left: 4px solid var(--primary-color);
    background: white;
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card .card-body h6 {
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-card .card-body h3,
.stat-card .card-body h2 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* ==================== TABLES ==================== */
.table {
    background: white;
    border-radius: 8px;
}

.table thead th {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* ==================== BADGES ==================== */
.badge {
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-link {
    text-decoration: none;
}

.btn-link:hover {
    opacity: 0.8;
}

/* ==================== FORMS ==================== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

/* ==================== AUTH PAGES ==================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.auth-card-header {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
}

.auth-card-header h2,
.auth-card-header p {
    margin: 0;
    color: white;
}

.auth-card-header h2 {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-card-body {
    padding: 2.5rem 2rem;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

/* ==================== TEXT VISIBILITY FIXES ==================== */
.bg-gradient h3,
.bg-gradient p {
    color: white !important;
}

.card-body h6,
.card-header h5,
.card-header h6 {
    color: #374151 !important;
}

/* ==================== CODE BLOCKS ==================== */
code {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
    color: #db2777;
}

/* ==================== PAGINATION ==================== */
.pagination {
    margin-top: 2rem;
}

.page-link {
    border-radius: 6px;
    margin: 0 0.25rem;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-weight: 500;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== ALERTS ==================== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ==================== MODALS ==================== */
.modal-content {
    border-radius: 16px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* ==================== DROPDOWNS ==================== */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    z-index: 1050;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* ==================== LOADING ==================== */
.spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 0.2em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== UTILITIES ==================== */
.cursor-pointer {
    cursor: pointer;
}

.toast-container {
    z-index: 9999 !important;
}

html {
    scroll-behavior: smooth;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== RESPONSIVE - MOBILE & TABLET ENHANCEMENTS ==================== */
@media (max-width: 992px) {
    .container, .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .card {
        margin-bottom: 1rem !important;
    }
    .navbar-brand {
        font-size: 1.2rem !important;
    }
    .auth-card {
        max-width: 100% !important;
        border-radius: 12px !important;
    }
    .auth-card-header, .auth-card-body {
        padding: 1.5rem 1rem !important;
    }
    .stat-card h2, .stat-card h3 {
        font-size: 1.2rem !important;
    }
    .table {
        font-size: 0.9rem !important;
    }
}
@media (max-width: 576px) {
    .navbar, .navbar-brand, .navbar .container, .navbar .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        min-height: 48px !important;
    }
    .navbar-brand {
        font-size: 1rem !important;
    }
    .dropdown-menu {
        font-size: 0.98rem !important;
        min-width: 180px;
    }
    .sidebar-heading {
        font-size: 1rem !important;
        padding: 1rem 1rem !important;
    }
    .list-group-item {
        font-size: 0.98rem !important;
        padding: 0.7rem 1rem !important;
    }
}
/* General improvements */
.card, .auth-card, .stat-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}
.card-header, .card-body, .auth-card-header, .auth-card-body {
    border-radius: 8px !important;
}
input, select, textarea {
    border-radius: 8px !important;
}
.navbar {
    border-radius: 0 0 12px 12px !important;
}

/* ==================== DOCUMENTATION LINKS ==================== */
.list-group-item i.bi-book, .nav-link[href*="docs"], .footer a[href*="docs"] {
    color: #3b82f6 !important;
    font-weight: 600;
}

/* ==================== FIX DROPDOWN USABILITY ==================== */
.dropdown-menu .dropdown-item {
    cursor: pointer;
    font-size: 1rem;
}

/* Docs text visibility fix */
.bg-dark, .code-block, .docs-section, pre.bg-dark, .docs-section pre {
    color: #fff !important;
}
.bg-white, .bg-light, .card, .docs-section .card, .docs-section .bg-white {
    color: #222 !important;
}
.docs-section h1, .docs-section h2, .docs-section h3, .docs-section h4, .docs-section h5, .docs-section h6 {
    color: #181c2a !important;
}
.docs-section .lead, .docs-section p, .docs-section li, .docs-section code {
    color: #222 !important;
}
.code-block {
    background: #181c2a !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 1rem;
}

/* Docs text visibility fix - always readable */
.docs-section, .docs-section .lead, .docs-section p, .docs-section li, .docs-section code, .docs-section pre, .docs-section .code-block {
    color: #181c2a !important;
    background: transparent !important;
}
.docs-section .bg-dark, .docs-section .code-block, .docs-section pre.bg-dark {
    color: #fff !important;
    background: #181c2a !important;
}
.docs-section .card, .docs-section .bg-white {
    color: #181c2a !important;
    background: #fff !important;
}
.docs-section h1, .docs-section h2, .docs-section h3, .docs-section h4, .docs-section h5, .docs-section h6 {
    color: #181c2a !important;
}

/* Responsive developer profile page */
@media (max-width: 768px) {
    .profile-section, .profile-section .card, .profile-section .row, .profile-section .col {
        padding: 0 !important;
        margin: 0 !important;
    }
    .profile-section .card {
        border-radius: 10px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    }
    .profile-section .card-body, .profile-section .card-header {
        padding: 1rem !important;
    }
    .profile-section form .form-control {
        font-size: 1rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}