/* Modern Rich Minimalist UI */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Rich Color Palette - Midnight & Gold */
    --primary-color: #0f172a;
    /* Midnight Navy */
    --primary-hover: #1e293b;
    /* Slate 800 */
    --primary-dark: #020617;
    /* Deepest Navy */

    --secondary-color: #475569;
    /* Slate 600 */
    --accent-color: #d97706;
    /* Rich Gold/Amber */

    --success-color: #059669;
    /* Emerald 600 */
    --warning-color: #d97706;
    /* Amber 600 */
    --danger-color: #dc2626;
    /* Red 600 */

    --bg-color: #f8fafc;
    /* Slate 50 */
    --card-bg: #ffffff;

    --text-main: #1e293b;
    /* Slate 800 - High Contrast */
    --text-muted: #64748b;
    /* Slate 500 */

    --border-color: #e2e8f0;
    /* Slate 200 */

    --primary-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    --accent-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Admin Card Fix */
.stats-card p,
.stats-card h3 {
    color: var(--text-main) !important;
    opacity: 1 !important;
}

/* Ensure icons in admin cards are visible */
.stats-card i {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 600;
    /* Reduced from 700 for professional look */
    letter-spacing: -0.015em;
    /* Slightly looser than -0.025 */
    margin-bottom: 0.75rem;
}

/* Breadcrumbs Match Search Button */
.breadcrumb-item a {
    color: #ffc107 !important;
    /* Bootstrap Warning Yellow */
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
}

/* Modern Header */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    color: #1e3a8a !important;
    /* Matches Hero Gradient End */
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar-toggler {
    border: none;
    color: var(--primary-dark);
}

.nav-link {
    color: var(--secondary-color) !important;
    font-weight: 600;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: transparent;
}

/* Rich Buttons */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    background: linear-gradient(to bottom right, #3b82f6, #1d4ed8);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #047857;
    border-color: #047857;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}

/* Cards - Subtle Lift & Polish */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.card-body {
    padding: 1.5rem;
}

/* Tables - Clean & readable */
.table th {
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.table td {
    vertical-align: middle;
    padding: 1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges - Softer Colors */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

.badge.bg-primary {
    background-color: #dbeafe !important;
    color: #1e40af;
}

.badge.bg-success {
    background-color: #d1fae5 !important;
    color: #065f46;
}

.badge.bg-warning {
    background-color: #fef3c7 !important;
    color: #92400e;
}

.badge.bg-info {
    background-color: #e0f2fe !important;
    color: #075985;
}

.badge.bg-secondary {
    background-color: #f1f5f9 !important;
    color: #475569;
}

.badge.bg-danger {
    background-color: #fee2e2 !important;
    color: #991b1b;
}

/* Alerts - Modern */
.alert {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.alert-info {
    background-color: #fff;
    border-left: 4px solid var(--primary-color);
    color: var(--text-main);
}

/* User Dashboard Welcome specific */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white !important;
}

.welcome-card h5,
.welcome-card p {
    color: white !important;
}

/* Utilities */
.text-muted {
    color: var(--text-muted) !important;
}

/* Admin Sidebar - Rich Slate Theme */
.admin-sidebar {
    background-color: #0f172a;
    /* Slate 900 */
    border-right: 1px solid #1e293b;
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: #94a3b8;
    /* Slate 400 */
    border-radius: 0;
    border-right: 3px solid transparent;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: #1e293b;
    color: #fff !important;
    border-right-color: var(--primary-color);
}

.admin-sidebar h6 {
    color: #64748b !important;
    padding-left: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
}

/* HOMEPAGE SPECIFIC STYLES */

/* Updated Hero Section */
.hero-section {
    background: var(--primary-gradient);
    color: white;
    padding: 6rem 0;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    /* Clean, modern shape */
    border-radius: 0 0 50px 50px;
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.4);
}

.hero-section .container {
    position: relative;
    z-index: 2;
    /* Fixes unclickable buttons */
}

/* Fix Browse Button Visibility in Hero */
.hero-section .btn-light {
    background: white;
    color: var(--primary-color) !important;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-section .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: #f8fafc;
}

.hero-section::before {
    /* Subtle pattern overlay */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
    pointer-events: none;
    /* Ensure clicks pass through */
}

.hero-section h1 {
    color: white;
    font-size: 3.5rem;
    font-weight: 800;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.hero-section .lead {
    font-weight: 500;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Brand Cards */
.brand-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Brand Card Hover Fix */
.brand-card:hover {
    background-color: white;
    /* Keep background white */
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.2);
}

.brand-card i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.brand-card:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.brand-card h6 {
    color: var(--text-main);
    font-weight: 600;
}

/* Price Badge on Manuals */
.price-badge {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
}

/* Manual Card Enhancement with Steering Wheel */
.manual-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.manual-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.manual-card .card-body {
    position: relative;
    z-index: 2;
}

/* Manual Card Text Fix */
.manual-card .text-muted {
    color: #64748b !important;
    /* Ensure visibility */
}

.manual-card h6 {
    color: #0f172a;
    font-weight: 700;
}

/* The Decoration Icon */
.watermark-icon {
    position: absolute;
    bottom: -15px;
    right: -15px;
    font-size: 5rem;
    color: rgba(0, 0, 0, 0.03);
    z-index: 1;
    transition: all 0.3s;
    transform: rotate(-15deg);
}

.manual-card:hover .watermark-icon {
    color: rgba(37, 99, 235, 0.08);
    /* Primary color low opacity */
    transform: rotate(0deg) scale(1.1);
}

/* Empty Cart State Fix */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    /* Reduced from default large size */
    color: #cbd5e1;
    /* Lighter grey */
    margin-bottom: 1.5rem;
    display: block;
}

/* Button Fixes */
.btn-outline-light {
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.btn-outline-light:hover {
    background-color: #fff;
    color: var(--primary-color);
}

/* Login to Buy Button - New Design */
.btn-login-buy {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1.2rem;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-login-buy:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Admin Login & Dark Background Fixes */
.bg-dark {
    background-color: #0f172a !important;
    /* Slate 900 */
    color: white !important;
}

/* Fix visibility of headings inside dark containers */
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6 {
    color: #ffffff !important;
}

/* Admin specific nav override */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}


/* Mobile Stack Table - Dashboard Fix */
@media (max-width: 768px) {
    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table,
    .mobile-stack-table tbody,
    .mobile-stack-table tr,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }

    .mobile-stack-table tr {
        background: #fff;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 1rem;
    }

    .mobile-stack-table td {
        padding: 0.5rem 0;
        text-align: right;
        /* align content to right */
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px dashed #eee;
    }

    .mobile-stack-table td:last-child {
        border-bottom: none;
        padding-top: 1rem;
        margin-top: 0.5rem;
        justify-content: center;
    }

    .mobile-stack-table td:last-child .btn {
        width: 100%;
    }

    /* Pseudo-labels for context (Optional but helpful) */
    .mobile-stack-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--secondary-color);
        font-size: 0.85rem;
    }
}