:root {
    --primary-color: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --success-light: #34d399;
    --danger-color: #ef4444;
    --danger-light: #f87171;
    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
    --info-color: #3b82f6;
    --info-light: #60a5fa;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
    margin: 0;
    padding-top: 56px;
}

/* Main layout wrapper */
.d-flex {
    display: flex;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #1f2937 !important;
    z-index: 100;
    padding: 1rem;
}

/* Ensure sidebar content is visible */
.sidebar * {
    visibility: visible !important;
}

.sidebar .nav {
    display: flex;
    flex-direction: column;
}

.sidebar .nav-item {
    display: block !important;
    width: 100%;
}

/* Main content area */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 56px);
    background-color: #f3f4f6;
    max-width: calc(100% - 250px);
    box-sizing: border-box;
}

.main-content .container-fluid {
    max-width: 100%;
    padding: 0;
}

/* Footer */
footer {
    margin-left: 0;
    width: 100%;
    transition: all 0.3s ease;
}

footer.dashboard-footer {
    margin-left: 250px;
    width: calc(100% - 250px);
}

footer a:hover {
    color: white !important;
    text-decoration: underline !important;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 66px;
    left: 10px;
    z-index: 1001;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #1d4ed8;
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle.active {
    background-color: #1d4ed8;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px;
        width: 100% !important;
        max-width: 100% !important;
    }

    footer,
    footer.dashboard-footer {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar-toggle {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle {
        display: none;
    }
}

.card {
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    border: none;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background-color: white;
    color: #1f2937;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

.stat-card {
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    background: white;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-card.success {
    border-top: 3px solid var(--success-color);
}

.stat-card.warning {
    border-top: 3px solid var(--warning-color);
}

.stat-card.danger {
    border-top: 3px solid var(--danger-color);
}

.stat-card.info {
    border-top: 3px solid var(--info-color);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 8px 0;
}

.stat-card h6 {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.wallet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.wallet-card h6 {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.wallet-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.lucky-draw-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
    transition: all 0.3s ease;
}

.lucky-draw-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.lucky-draw-card h6 {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.lucky-draw-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

.table {
    background-color: white;
    border-radius: 8px;
    margin-bottom: 0;
}

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

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Dashboard specific styles */
.dashboard-header h2 {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.875rem;
}

.dashboard-header .text-muted {
    color: #6b7280 !important;
}

/* Empty state styling */
.text-center .fa-3x {
    opacity: 0.3;
}

.text-center p.text-muted {
    font-size: 0.95rem;
}

/* Link styling */
a.text-decoration-none {
    color: #2563eb;
}

a.text-decoration-none:hover {
    color: #1d4ed8;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.team-member-card {
    transition: transform 0.3s;
    cursor: pointer;
}

.team-member-card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.lucky-draw-button {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    border: 5px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.winner-animation {
    animation: celebrate 1s ease-in-out;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-10deg);
    }
    75% {
        transform: scale(1.2) rotate(10deg);
    }
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-input {
    position: absolute;
    font-size: 100px;
    opacity: 0;
    right: 0;
    top: 0;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.timeline-item:after {
    content: '';
    position: absolute;
    left: -19px;
    top: 15px;
    width: 2px;
    height: calc(100% - 10px);
    background-color: #dee2e6;
}

.timeline-item:last-child:after {
    display: none;
}

.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--secondary-color);
}

.status-pending {
    color: var(--warning-color);
}

.status-completed {
    color: var(--info-color);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navbar Styling */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 56px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}


/* Icon Styling */
.stat-card i {
    opacity: 0.3;
    font-size: 3rem;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

/* Badge Styling */
.bg-success {
    background-color: var(--success-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

@media (max-width: 768px) {
    .stat-card h3 {
        font-size: 1.5rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        overflow-x: auto;
    }
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.kyc-document-preview {
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    padding: 5px;
}

/* Admin and User Page Specific Styles */
.admin-page .navbar {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
}

.user-page .navbar {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

/* Sidebar Color Differentiation */
.admin-page .sidebar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%) !important;
}

.user-page .sidebar {
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%) !important;
}

/* Smooth scrollbar for sidebar */
.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);
}

/* Navbar badge styling */
.navbar-brand .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
}

/* Footer link hover effect */
footer ul li {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

footer ul li:hover {
    transform: translateX(5px);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-brand .badge {
        font-size: 0.5rem;
        padding: 0.2rem 0.4rem;
    }

    footer h5 {
        font-size: 1rem;
    }

    footer p,
    footer li {
        font-size: 0.875rem;
    }
}

/* Modern Dashboard Enhancements */
.dashboard-header h2 {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern Stat Cards */
.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    border: none !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-color), var(--success-light));
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-color), var(--warning-light));
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger-color), var(--danger-light));
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info-color), var(--info-light));
}

.stat-card h3 {
    font-weight: 800;
    font-size: 2.25rem;
    background: linear-gradient(135deg, #1f2937, #374151);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Wallet Cards Enhancement */
.wallet-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.lucky-draw-card {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    position: relative;
    overflow: hidden;
}

.lucky-draw-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Modern Table Styles */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    padding: 16px;
    border: none;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f9fafb;
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Modern Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

/* Modern Buttons */
.btn {
    border-radius: 12px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.2);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Card Header Enhancement */
.card-header {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-bottom: 2px solid #f3f4f6;
    padding: 1.25rem 1.5rem;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

/* Timeline Enhancement */
.timeline-item {
    padding: 1rem;
    border-left: 3px solid #e5e7eb;
    margin-left: 1rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 1.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--primary-color);
}

/* Modern Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
}

/* Loading Animation */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Smooth Transitions */
* {
    scroll-behavior: smooth;
}

/* Focus Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
