/* Dynamic and Premium Branding Styling - Vanilla CSS */

:root {
    /* Color tokens - overridden dynamically in HTML from database settings */
    --primary-color: #ec4899;
    --primary-hover: #db2777;
    --secondary-color: #8b5cf6;
    --secondary-hover: #7c3aed;
    --accent-color: #f59e0b;
    
    /* Layout Backgrounds */
    --bg-app: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-nav: rgba(255, 255, 255, 0.8);
    --border-color: rgba(226, 232, 240, 0.8);
    
    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Visual Effects */
    --glass-blur: 12px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Font family */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* UI state colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    --color-warning: #f59e0b;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-app: #090d16;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-nav: rgba(17, 24, 39, 0.8);
    --border-color: rgba(55, 65, 81, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* Base Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
}

/* Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.nav-badge-container {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 9999px;
    line-height: 1;
}

/* Layout container */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    margin-bottom: 3rem;
    padding: 3.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Alert Boxes / Toast */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Shop Product Catalog Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.product-image-wrapper {
    position: relative;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    background-color: #f1f5f9;
    overflow: hidden;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge-stock {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

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

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

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--color-error);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* Authentication Page Styles */
.auth-container {
    max-width: 450px;
    width: 100%;
    margin: 4rem auto;
}

.auth-card {
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

/* Cart Page Styles */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

.cart-items-container {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: #f1f5f9;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-input {
    width: 60px;
    padding: 0.35rem;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    outline: none;
}

.cart-summary {
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.summary-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Dashboard / Admin Panel Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 120px);
}

@media (max-width: 992px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: start;
}

.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem 0.5rem;
}

.sidebar-heading:first-child {
    margin-top: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--primary-color);
    background-color: rgba(236, 72, 153, 0.08);
}

.admin-main {
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

/* Dashboard Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Table Style */
.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
}

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

.table th {
    padding: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.5);
}

/* Status Badges */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

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

.badge-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* Footer Section */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 2.5rem 2rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Audit Log detail text */
.audit-details {
    font-family: monospace;
    font-size: 0.8rem;
    background-color: rgba(0,0,0,0.03);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    max-width: 400px;
    word-break: break-all;
    white-space: pre-wrap;
}

/* File inputs visual customization */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Pagination links */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin-top: 1.5rem;
    gap: 0.25rem;
}

.pagination li a, .pagination li span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.pagination li.active span {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
