:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --dark: #2d3436;
    --darker: #1a1a2e;
    --light: #f8f9fe;
    --gradient: linear-gradient(135deg, #6c5ce7, #00cec9);
    --gradient-reverse: linear-gradient(135deg, #00cec9, #6c5ce7);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
    --shadow-md: 0 8px 30px rgba(108, 92, 231, 0.12);
    --shadow-lg: 0 20px 60px rgba(108, 92, 231, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f0f2f8;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2d3436;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--darker);
}

/* Navbar */
.navbar {
    background: var(--darker) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0.8rem 0;
}

.navbar .container,
.navbar .container-fluid {
    overflow: visible;
}

.navbar-collapse {
    overflow: visible;
}

.nav-item.dropdown {
    position: relative;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
}

.navbar .nav-link:hover {
    background: rgba(108, 92, 231, 0.15);
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.75);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white;
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    padding: 0.5rem;
    min-width: 220px;
    background: white;
    z-index: 9999;
}

@media (max-width: 991.98px) {
    .navbar .dropdown-menu {
        box-shadow: none;
        background: transparent;
        padding: 0 0 0 1rem;
        min-width: auto;
    }
    .navbar .dropdown-menu .dropdown-item {
        color: rgba(255,255,255,0.75);
    }
    .navbar .dropdown-menu .dropdown-item:hover {
        color: white;
        background: rgba(108,92,231,0.15);
        transform: none;
    }
    .navbar .dropdown-menu .dropdown-divider {
        border-color: rgba(255,255,255,0.1);
    }
}

.navbar .dropdown-menu .dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar .dropdown-menu .dropdown-item:hover {
    background: rgba(108, 92, 231, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.navbar .dropdown-menu .dropdown-divider {
    margin: 0.3rem 0;
}

.navbar .dropdown-toggle::after {
    vertical-align: middle;
}

/* Hero Section */
.hero-section {
    background: var(--gradient);
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    padding: 4rem 2rem !important;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.hero-section h1 {
    color: white !important;
    font-size: 3rem;
    position: relative;
    z-index: 1;
}

.hero-section .lead {
    color: rgba(255,255,255,0.85) !important;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.hero-section .btn-primary {
    background: white;
    color: var(--primary);
    border: none;
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.hero-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    background: #f8f9fe;
    color: var(--primary-dark);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

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

.card .card-img-top {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    padding: 2rem;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
}

.card .btn {
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 1.2rem;
}

/* Buttons */
.btn {
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.6rem 1.5rem;
}

.btn-primary {
    background: var(--gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.35);
    background: var(--gradient-reverse);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-warning:hover {
    background: linear-gradient(135deg, #fdcb6e, #f39c12);
    border-color: transparent;
    color: white;
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, #ff7675, #d63031);
    border-color: transparent;
    color: white;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid #e9ecef;
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

/* Tables */
.table {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table-dark {
    background: var(--darker);
}

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

.table-hover tbody tr:hover {
    background: rgba(108, 92, 231, 0.04);
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    color: #2d3436;
    border-left: 4px solid #00b894;
}

.alert-danger {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
    border-left: 4px solid #d63031;
}

.alert-info {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    color: #2d3436;
    border-left: 4px solid #0984e3;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
}

/* Sidebar (Admin) */
.sidebar {
    background: white !important;
    border-right: 1px solid #e9ecef;
}

.sidebar .nav-link {
    color: var(--dark);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background: rgba(108, 92, 231, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Footer */
footer {
    background: var(--darker) !important;
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer a:hover {
    color: var(--secondary) !important;
}

/* List Groups (Category sidebar) */
.list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.list-group-item:hover {
    background: rgba(108, 92, 231, 0.06);
    color: var(--primary);
    padding-left: 1.3rem;
}

.list-group-item.active {
    background: var(--gradient);
    color: white;
    border: none;
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Accordion (FAQ) */
.accordion-item {
    border: none;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-button {
    font-weight: 600;
    color: var(--dark);
    background: white;
    padding: 1.2rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background: var(--gradient);
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    padding: 1.5rem;
    background: white;
}

/* Dashboard Cards */
.card.border-primary { background: linear-gradient(135deg, rgba(108,92,231,0.08), rgba(108,92,231,0.02)); border: 2px solid rgba(108,92,231,0.2) !important; }
.card.border-success { background: linear-gradient(135deg, rgba(0,184,148,0.08), rgba(0,184,148,0.02)); border: 2px solid rgba(0,184,148,0.2) !important; }
.card.border-info { background: linear-gradient(135deg, rgba(9,132,227,0.08), rgba(9,132,227,0.02)); border: 2px solid rgba(9,132,227,0.2) !important; }
.card.border-warning { background: linear-gradient(135deg, rgba(253,203,110,0.08), rgba(253,203,110,0.02)); border: 2px solid rgba(253,203,110,0.2) !important; }

.card.border-primary .card-body h1,
.card.border-primary .card-body p { color: var(--primary); }
.card.border-success .card-body h1,
.card.border-success .card-body p { color: #00b894; }
.card.border-info .card-body h1,
.card.border-info .card-body p { color: #0984e3; }
.card.border-warning .card-body h4,
.card.border-warning .card-body p { color: #e17055; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f2f8;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 50px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .hero-section, .accordion-item {
    animation: fadeInUp 0.5s ease forwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

/* Page heading underline */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 50px;
    margin-top: 0.5rem;
}

h4::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--gradient);
    border-radius: 50px;
    margin-top: 0.3rem;
}

/* Collapse transitions */
.collapse {
    transition: all 0.35s ease;
}

/* Modal-like form cards inside collapse */
#productForm .card,
#userForm .card,
#catForm .card {
    border: 2px solid rgba(108,92,231,0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 1.5rem !important;
        border-radius: var(--radius-md);
    }
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    .table {
        font-size: 0.85rem;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Print */
@media print {
    .navbar, footer, .sidebar, .btn, form { display: none; }
}
