/* ========================================
   USER PANEL MAIN CONTENT - ISOLATED CSS
   ======================================== */

/* Main content CSS variables */
:root {
    --content-bg: #f8fafc;
    --content-border: #e5e7eb;
    --content-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --content-radius: 12px;
    --content-padding: 24px;
    --sidebar-width: 280px;
    --header-height: 70px;
}

/* Base text color enforcement for readability */
body, .main-content, .page-header, .card, .card-body, .card-header, .card-footer {
    color: #111827; /* near-black for high contrast */
}

/* Ensure general text defaults to black inside main content */
.main-content *:not(.btn):not(.nav-link):not(.badge):not(.text-muted) {
    color: #111827;
}

/* Muted text readable on light backgrounds */
.text-muted, .form-text, .page-subtitle, .card .text-muted {
    color: #4b5563 !important; /* darker muted */
}

/* Links inside cards and content */
.main-content a:not(.btn):not(.nav-link) {
    color: #0f172a;
    text-decoration: none;
}
.main-content a:not(.btn):not(.nav-link):hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumb a {
    color: #111827;
}
.breadcrumb .active {
    color: #4b5563;
}

/* Fix table text color */
.table, .table td, .table th {
    color: #111827;
}

/* Inputs and labels */
.form-label {
    color: #111827;
}
.form-control, .form-select {
    color: #111827;
    background-color: #ffffff;
}

/* Alerts text contrast */
.alert-success, .alert-warning, .alert-danger, .alert-info {
    color: #111827;
}

/* Mobile bottom nav labels */
.mobile-bottom-nav .nav-link span {
    color: #111827;
}

/* Sidebar items text override when light sections leak styles */
.user-sidebar .nav-item a .nav-text { color: rgba(255,255,255,0.9); }

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: var(--content-padding);
    min-height: calc(100vh - var(--header-height));
    background: var(--content-bg);
    transition: all 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Page Header */
.page-header {
    background: #ffffff;
    border-radius: var(--content-radius);
    padding: var(--content-padding);
    margin-bottom: 24px;
    box-shadow: var(--content-shadow);
    border: 1px solid var(--content-border);
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: #4a67ff;
    font-size: 2rem;
}

.page-subtitle {
    color: #6b7280;
    margin: 8px 0 0 0;
    font-size: 1.125rem;
    font-weight: 400;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid var(--content-border);
    border-radius: var(--content-radius);
    box-shadow: var(--content-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 24px;
}

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

.card-header {
    background: #f9fafb;
    border-bottom: 1px solid var(--content-border);
    padding: 20px 24px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    background: #f9fafb;
    border-top: 1px solid var(--content-border);
    padding: 16px 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: #4a67ff;
    color: white;
}

.btn-primary:hover {
    background: #3a56e4;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74, 103, 255, 0.3);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #6b7280;
}

.btn-outline:hover {
    border-color: #4a67ff;
    color: #4a67ff;
    background: rgba(74, 103, 255, 0.05);
}

/* Forms */
.form-control, .form-select {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    border-color: #4a67ff;
    box-shadow: 0 0 0 3px rgba(74, 103, 255, 0.1);
    outline: none;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #cffafe;
    color: #0e7490;
    border-left: 4px solid #06b6d4;
}

/* Tables */
.table {
    background: #ffffff;
    border-radius: var(--content-radius);
    overflow: hidden;
    box-shadow: var(--content-shadow);
    margin-bottom: 0;
}

.table thead th {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    padding: 16px 20px;
    font-size: 0.9rem;
}

.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    font-size: 0.9rem;
}

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

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #e8f0ff;
    color: #4a67ff;
}

.badge-success {
    background: #d1fae5;
    color: #10b981;
}

.badge-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.badge-danger {
    background: #fee2e2;
    color: #ef4444;
}

/* Utilities */
.text-primary { color: #4a67ff !important; }
.text-success { color: #10b981 !important; }
.text-warning { color: #f59e0b !important; }
.text-danger { color: #ef4444 !important; }
.text-info { color: #06b6d4 !important; }

.bg-primary { background-color: #4a67ff !important; }
.bg-success { background-color: #10b981 !important; }
.bg-warning { background-color: #f59e0b !important; }
.bg-danger { background-color: #ef4444 !important; }
.bg-info { background-color: #06b6d4 !important; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; }
.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important; }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important; }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important; }

.rounded { border-radius: 8px !important; }
.rounded-sm { border-radius: 4px !important; }
.rounded-lg { border-radius: 12px !important; }

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        margin-top: 60px !important;
        padding: 16px !important;
        width: 100% !important;
    }
    
    .page-header {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .page-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .page-title i {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 16px;
    }
    
    .card-header,
    .card-body,
    .card-footer {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 12px;
        margin-top: 60px;
    }
    
    .page-header {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-title i {
        font-size: 1.25rem;
    }
    
    .card-header,
    .card-body,
    .card-footer {
        padding: 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
}

.mobile-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 4px;
    border-radius: 8px;
}

.mobile-bottom-nav .nav-link:hover,
.mobile-bottom-nav .nav-link.active {
    color: #4a67ff;
    background-color: rgba(74, 103, 255, 0.1);
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.25rem;
}
