/* =========================================================
   CODEFLIPPERS GLOBAL THEME
   This file syncs the UI across all public and admin pages.
   ========================================================= */

/* 1. Import Modern Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* 2. Global Design Variables (The "Brand DNA") */
:root {
    /* Brand Colors */
    --cf-primary: #4f46e5;      /* Modern Indigo */
    --cf-primary-hover: #4338ca;
    --cf-secondary: #64748b;    /* Soft Slate */
    
    /* Backgrounds & Surfaces */
    --cf-bg-light: #f8fafc;     /* Main background */
    --cf-surface: #ffffff;      /* Cards, Modals, Navbars */
    --cf-border: #e2e8f0;       /* Soft borders */
    
    /* Typography Colors */
    --cf-text-main: #0f172a;    /* Very dark blue/grey for readability */
    --cf-text-muted: #64748b;   /* Muted text */
    
    /* Layout & Feel */
    --cf-radius-sm: 8px;
    --cf-radius-md: 12px;
    --cf-radius-lg: 16px;
    
    /* Soft, modern shadows */
    --cf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --cf-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --cf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* 3. Base Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    background-color: var(--cf-bg-light);
    color: var(--cf-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--cf-text-main);
    letter-spacing: -0.025em; /* Makes headings look tighter and more modern */
}

/* 4. Standardize Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--cf-radius-sm);
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--cf-primary);
    border-color: var(--cf-primary);
    color: white;
    box-shadow: var(--cf-shadow-sm);
}

.btn-primary:hover {
    background-color: var(--cf-primary-hover);
    border-color: var(--cf-primary-hover);
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: var(--cf-shadow-md);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Enhanced form controls */
.form-control, .form-select {
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cf-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: 0;
}

.form-label {
    font-weight: 500;
    color: var(--cf-text-main);
    margin-bottom: 0.5rem;
}

/* 5. Standardize Cards (Admin & Storefront) */
.card {
    background-color: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-md);
    box-shadow: var(--cf-shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

/* Enhanced card header */
.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--cf-border);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-top-left-radius: calc(var(--cf-radius-md) - 1px);
    border-top-right-radius: calc(var(--cf-radius-md) - 1px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--cf-border);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* 6. Form Inputs (Checkout & Admin Login) */
.form-control, .form-select {
    border-radius: var(--cf-radius-sm);
    border: 1px solid var(--cf-border);
    padding: 0.6rem 1rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cf-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); /* Soft glowing focus ring */
}

/* 7. Tables (Admin Panel) */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--cf-text-muted);
    border-bottom-width: 1px;
    padding: 1rem;
    background-color: #f8fafc;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--cf-text-main);
    border-bottom: 1px solid var(--cf-border);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Responsive tables */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: var(--cf-radius-md);
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
    }
}

/* 8. Admin Sidebar Tweaks */
.sidebar {
    background-color: #0f172a !important; /* Very dark slate */
    border-right: 1px solid #1e293b;
}

.sidebar a.active {
    background-color: var(--cf-primary) !important;
    font-weight: 500;
    box-shadow: var(--cf-shadow-sm);
}

/* 9. Badges (Paid, Pending status) */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 9999px; /* Pill shape */
    border: none;
}

.badge.bg-primary {
    background-color: var(--cf-primary) !important;
}

.badge.bg-success {
    background-color: #10b981 !important;
}

.badge.bg-warning {
    background-color: #f59e0b !important;
}

.badge.bg-danger {
    background-color: #ef4444 !important;
}

/* Improved navigation links */
.nav-link {
    transition: all 0.2s ease;
    border-radius: var(--cf-radius-sm);
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

/* Enhanced dropdown menu */
.dropdown-menu {
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-md);
    box-shadow: var(--cf-shadow-lg);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

/* Modal enhancements */
.modal-content {
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-lg);
    box-shadow: var(--cf-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--cf-border);
    padding: 1rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--cf-border);
    padding: 1rem 1.5rem;
}