/*
 * Cashoria V2.0 - Professional CSS Theme (Layout Fixed)
 * Developed by Gemini
 * Date: 30-09-2025
 */

/* 1. Google Fonts & CSS Variables
-------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd; /* Blue */
    --secondary-color: #6c757d; /* Gray */
    --success-color: #198754; /* Green */
    --danger-color: #dc3545; /* Red */
    --warning-color: #ffc107; /* Yellow */
    --info-color: #0dcaf0;   /* Cyan */
    
    --background-color: #f0f2f5; /* Light Gray Background */
    --card-background-color: #ffffff;
    --text-color-dark: #212529;
    --text-color-light: #6c757d;
    
    --default-border-color: #dee2e6;
    --default-border-radius: 0.75rem; /* 12px */
    --default-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2. Global Styles & Resets
-------------------------------------------------- */
body, html {
    height: 100%;
}

body {
    background-color: var(--background-color);
    font-family: var(--font-family-sans-serif);
    color: var(--text-color-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* This makes the main site footer sticky, but doesn't affect the admin panel */
body:not(.admin-body) {
    display: flex;
    flex-direction: column;
}
main.container {
    flex: 1;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #0b5ed7;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* 3. Layout & Main Components
-------------------------------------------------- */

/* --- !! LAYOUT FIX FOR ADMIN PANEL !! --- */
.main-wrapper {
    display: flex; /* This is the MOST IMPORTANT rule that was missing */
    min-height: 100vh;
}

.content-wrapper {
    flex-grow: 1; /* This tells the content to take up all available space */
    padding: 2rem;
    width: calc(100% - 260px); /* Provides a fallback width calculation */
}
/* --- END LAYOUT FIX --- */

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar-brand img {
    max-height: 40px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--default-border-radius);
    box-shadow: var(--default-box-shadow);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card-header {
    background-color: var(--card-background-color);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--default-border-color);
    font-size: 1.1rem;
    font-weight: 600;
    border-top-left-radius: var(--default-border-radius);
    border-top-right-radius: var(--default-border-radius);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid var(--default-border-color);
    border-bottom-left-radius: var(--default-border-radius);
    border-bottom-right-radius: var(--default-border-radius);
}

/* Buttons, Forms, Tables etc. remain the same */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease-in-out;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.form-control, .form-select {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--default-border-color);
    background-color: #f8f9fa;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    background-color: #fff;
}
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.table>:not(caption)>*>* {
    padding: 0.9rem 0.9rem;
    vertical-align: middle;
}
.table thead th {
    background-color: #f8f9fa;
    border-bottom-width: 1px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.table tbody tr:hover {
    background-color: rgba(0,0,0,0.025);
}

/* 4. User Dashboard Specifics
-------------------------------------------------- */
.stat-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}
.stat-card .stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
    margin-right: 1.5rem;
    color: #fff;
}
.stat-card .stat-info h5 {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-color-light);
    text-transform: uppercase;
}
.stat-card .stat-info p {
    margin-bottom: 0;
    font-size: 1.75rem;
    font-weight: 700;
}
.offer-card .reward-badge {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
    padding: 0.5rem 1rem;
    border-radius: 50rem;
    font-weight: 600;
}

/* 5. Admin Panel Specifics
-------------------------------------------------- */
.admin-sidebar {
    width: 260px;
    flex-shrink: 0; /* Prevents sidebar from shrinking */
    min-height: 100vh;
    background-color: var(--text-color-dark);
    box-shadow: 0.75rem 0 1.5rem rgba(0,0,0,0.05);
    z-index: 100;
    transition: margin-left 0.3s ease;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.65);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.admin-sidebar .nav-link .fa-fw {
    margin-right: 0.75rem;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
}

.admin-sidebar .sidebar-heading {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 6. Responsive Design
-------------------------------------------------- */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }
    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .stat-card .stat-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}
