/* Import Outfit and Fira Code Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-darker: #080c14;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Neon Accents */
    --accent-primary: #8b5cf6; /* Violet */
    --accent-secondary: #06b6d4; /* Cyan */
    --accent-success: #10b981; /* Emerald */
    --accent-warning: #f59e0b; /* Amber */
    --accent-danger: #ef4444; /* Rose */
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    --gradient-hover: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
    
    /* Formatting */
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-accent: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea {
    font-family: inherit;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    background: rgba(8, 12, 20, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 28px;
}

.nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background: rgba(8, 12, 20, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 32px 40px 32px;
    gap: 20px;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    list-style: none;
}

.nav-links.active {
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.nav-links li {
    width: 100%;
}

.nav-link {
    display: block;
    padding: 8px 0;
    font-size: 18px;
    width: 100%;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent-secondary);
    font-weight: 600;
}

.nav-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--gradient-hover);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 90px 0 60px 0;
}

.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 36px auto;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: 100%;
}

.flash-message {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease forwards;
}

.flash-message.success {
    border-left: 4px solid var(--accent-success);
}

.flash-message.error {
    border-left: 4px solid var(--accent-danger);
}

.flash-message.info {
    border-left: 4px solid var(--accent-secondary);
}

.flash-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s ease;
}

.flash-close:hover {
    color: var(--text-primary);
}

/* Storefront Grid */
.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}

/* Glassmorphic Product Card */
.product-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.product-card:hover::before {
    opacity: 1;
}

.product-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.product-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-secondary);
    font-weight: 700;
    margin-bottom: 8px;
}

.product-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.product-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.product-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-description {
    color: var(--text-secondary);
    font-size: 15px;
}

.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.features-list li {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-list li::before {
    content: '✓';
    color: var(--accent-success);
    font-weight: bold;
}

/* Code Preview Terminal Window */
.code-preview-container {
    background: #05070c;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: auto;
}

.code-header {
    background: #0d1117;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }

.code-lang {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.code-preview {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 16px;
    color: #e2e8f0;
    background: #05070c;
    overflow-x: auto;
    white-space: pre;
    max-height: 180px;
}

.product-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(8, 12, 20, 0.4);
}

.btn-buy {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-align: center;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

/* Authentication Forms (Login / Register) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 40px 24px;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--shadow-glow);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(8, 12, 20, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    background: rgba(8, 12, 20, 0.8);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-secondary);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Styles (Admin & Customer) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 60px;
}

@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
    
    .dashboard-grid.full-width {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
}

.dashboard-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-item {
    background: rgba(8, 12, 20, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modern Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    background: rgba(8, 12, 20, 0.4);
}

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

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-primary);
}

.badge-secondary {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-secondary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

/* Footer */
.footer {
    margin-top: auto;
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Mobile Responsive Styling */

/* Hamburger menu styling */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.nav-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Transform hamburger into an 'X' when active */
.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 991px) {
    .nav-container {
        height: 70px;
    }
    
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        background: rgba(8, 12, 20, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-right: 1px solid var(--border-color);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 90px 32px 40px 32px;
        gap: 20px;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .nav-links.active {
        left: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 8px 0;
        font-size: 18px;
        width: 100%;
    }

    .nav-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    /* Transform hamburger into an 'X' when active */
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 50px 0 30px 0;
    }

    .hero h1 {
        font-size: 32px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 16px;
        margin-bottom: 24px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 50px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-header h2 {
        font-size: 24px;
    }

    .dashboard-card {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .table th, .table td {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .flash-messages {
        right: 16px;
        left: 16px;
        width: calc(100% - 32px);
        max-width: none;
        top: 80px;
    }
    
    .logo {
        font-size: 20px;
    }
}
