/* Campus Mart - Advanced Premium UI Styles (Refined) */

/* ========== CSS Variables ========== */
:root {
    /* Brand Colors */
    --primary-color: #134061;
    --primary-dark: #0A2540;
    --primary-light: #1E5A8E;
    --secondary-color: #F8CA2F;
    --secondary-dark: #E6B829;
    --accent-color: #FEFEFE;

    /* UI Colors */
    --bg-primary: #FEFEFE;
    --bg-secondary: #F5F7FA;
    --bg-tertiary: #E8EDF3;
    --bg-dark: #0A1929;
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --border-color: #E2E8F0;

    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #134061 0%, #1E5A8E 100%);
    --gradient-secondary: linear-gradient(135deg, #F8CA2F 0%, #FFD54F 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    --gradient-pink: linear-gradient(135deg, #EC4899 0%, #F472B6 100%);
    --gradient-blue: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    --gradient-orange: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 24px -4px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(248, 202, 47, 0.4);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== Reset & Base ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    font-size: 16px;
    scroll-behavior: smooth
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

img {
    max-width: 100%;
    height: auto;
    display: block
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base)
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition-base)
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit
}

/* ========== Typography (Refined) ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.01em
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem)
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.875rem)
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem)
}

h4 {
    font-size: 1.125rem
}

h5 {
    font-size: 1rem
}

h6 {
    font-size: 0.875rem
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md)
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md)
}

/* ========== Header (Compact & Responsive) ========== */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px)
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md)
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.25rem
}

.logo span {
    color: var(--secondary-color)
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: var(--transition-base)
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white
}

.mobile-menu-toggle {
    display: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer
}

/* ========== Buttons (Compact) ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
    text-align: center;
    white-space: nowrap;
    font-size: 0.9375rem;
    box-shadow: var(--shadow-sm)
}

.btn-primary {
    background: var(--gradient-primary);
    color: white
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md)
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--primary-color)
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md)
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color)
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px)
}

.btn-danger {
    background: var(--gradient-pink);
    color: white
}

.btn-success {
    background: var(--gradient-success);
    color: white
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem
}

.btn-block {
    width: 100%
}

/* ========== Forms (Compact) ========== */
.form-group {
    margin-bottom: 1rem
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: var(--transition-base);
    background: white
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(19, 64, 97, 0.1)
}

textarea.form-control {
    resize: vertical;
    min-height: 100px
}

.form-error {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 0.25rem
}

/* ========== Cards (Compact) ========== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05)
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px)
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary))
}

.card-body {
    padding: 1rem
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary)
}

/* ========== Product Card (Compact) ========== */
.product-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid var(--border-color)
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color)
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: var(--bg-secondary)
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-base)
}

.product-card:hover .product-image img {
    transform: scale(1.05)
}

.product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--gradient-secondary);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: var(--shadow-sm)
}

.product-info {
    padding: 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto
}

/* ========== Grid System (Adjusted) ========== */
.grid {
    display: grid;
    gap: 1.5rem
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr)
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr)
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr)
}

/* ========== Alerts ========== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
    font-size: 0.9375rem
}

.alert-success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #065F46;
    border-color: var(--success)
}

.alert-error {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
    border-color: var(--error)
}

.alert-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    border-color: var(--warning)
}

.alert-info {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
    border-color: var(--info)
}

/* ========== Badges ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px
}

.badge-primary {
    background: var(--gradient-primary);
    color: white
}

.badge-secondary {
    background: var(--gradient-secondary);
    color: var(--primary-color)
}

.badge-success {
    background: var(--gradient-success);
    color: white
}

/* ========== Hero Section (Compact) ========== */
.hero {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: white;
    font-weight: 800
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9)
}

/* ========== Categories (Compact) ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0
}

.category-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    cursor: pointer;
    border: 1px solid transparent
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color)
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem
}

.category-name {
    font-weight: 600;
    font-size: 0.9375rem
}

/* ========== Footer (Compact) ========== */
.footer {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0f1f2e 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1rem
}

.footer-links {
    list-style: none
}

.footer-links li {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem
}

.footer-links a:hover {
    color: var(--secondary-color)
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem
}

/* ========== Utilities ========== */
.text-center {
    text-align: center
}

.text-right {
    text-align: right
}

.text-left {
    text-align: left
}

.mt-1 {
    margin-top: 0.5rem
}

.mt-2 {
    margin-top: 1rem
}

.mt-3 {
    margin-top: 1.5rem
}

.mt-4 {
    margin-top: 2rem
}

.mb-1 {
    margin-bottom: 0.5rem
}

.mb-2 {
    margin-bottom: 1rem
}

.mb-3 {
    margin-bottom: 1.5rem
}

.mb-4 {
    margin-bottom: 2rem
}

.p-1 {
    padding: 0.5rem
}

.p-2 {
    padding: 1rem
}

.p-3 {
    padding: 1.5rem
}

.p-4 {
    padding: 2rem
}

.flex {
    display: flex
}

.flex-col {
    flex-direction: column
}

.items-center {
    align-items: center
}

.justify-between {
    justify-content: space-between
}

.gap-1 {
    gap: 0.5rem
}

.gap-2 {
    gap: 1rem
}

.gap-3 {
    gap: 1.5rem
}

/* ========== Responsive ========== */
@media(max-width:992px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:768px) {
    h1 {
        font-size: 1.75rem
    }

    h2 {
        font-size: 1.5rem
    }

    h3 {
        font-size: 1.25rem
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr)
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-color);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        align-items: stretch
    }

    .nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease-out
    }

    .nav-link {
        text-align: center;
        padding: 0.75rem
    }

    .mobile-menu-toggle {
        display: block
    }

    .header-content {
        padding: 0 0.5rem
    }
}

@media(max-width:480px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem
    }

    .product-info {
        padding: 0.75rem
    }

    .product-title {
        font-size: 0.875rem
    }

    .product-price {
        font-size: 1rem
    }

    .container {
        padding: 0 0.75rem
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.05)
    }
}