﻿/* ================================================================
   ECMClaudia — Pastel Color Palette
   ================================================================ */

/* ---------------------------------------------------------------
   CSS Variables
   --------------------------------------------------------------- */
:root {
    /* Backgrounds */
    --bg-main: #FAFAF8;
    --bg-card: #F5F0E8;
    --bg-nav: #4A6B7A;
    --bg-footer: #3D5A68;
    --bg-input: #FFFFFF;
    --bg-hover: #EDE8E0;
    --bg-table-alt: #F0EBE3;
    /* Text */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-on-dark: #FFFFFF;
    --text-on-card: #444444;
    --text-price: #4A7A5A;
    --text-link: #5B8FA8;
    --text-link-hover: #3A6E87;
    /* Brand / Primary */
    --primary: #5B8FA8;
    --primary-dark: #3A6E87;
    --primary-light: #A8C8D8;
    /* Accent */
    --accent: #6B9E7A;
    --accent-dark: #4A7A5A;
    --accent-light: #B0D0B8;
    /* Borders */
    --border: #D5CFC8;
    --border-light: #E8E3DC;
    --border-focus: #5B8FA8;
    /* Status */
    --success: #5B9E6B;
    --success-bg: #D8F0DE;
    --warning: #C8935A;
    --warning-bg: #F5E5D0;
    --error: #C86B6B;
    --error-bg: #F5D8D8;
    --info: #5B8FA8;
    --info-bg: #D8EAF5;
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 3px 8px rgba(0,0,0,0.10);
    --shadow-lg: 0 6px 16px rgba(0,0,0,0.12);
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 50px;
    /* Transitions */
    --transition: all 0.2s ease;
}

/* ---------------------------------------------------------------
   Base / Reset
   --------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 0;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.3rem;
}

h4 {
    font-size: 1.1rem;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition);
}

    a:hover {
        color: var(--text-link-hover);
        text-decoration: underline;
    }

p {
    margin: 0 0 1rem 0;
}

img {
    max-width: 100%;
    height: auto;
}


.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #276138;
    border: 1px solid #a8d5b5;
}

.alert-error {
    background: #fde8e8;
    color: #7a2828;
    border: 1px solid #f5b8b8;
}

.alert-info {
    background: #e8f0fd;
    color: #284a7a;
    border: 1px solid #b8ccf5;
}

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

.main-content {
    min-height: calc(100vh - 140px);
    padding: 24px 16px;
}

@if (Context.Session.GetInt32("CustomerID") != null) {
    <a href="/Account/ChangePassword">Change Password</a>
}

else {
    <a href="/Account/ForgotPassword">Forgot Password</a>
}

/* ---------------------------------------------------------------
   Navigation
   --------------------------------------------------------------- */
.navbar {
    background-color: var(--bg-nav);
    color: var(--text-on-dark);
    padding: 0 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-on-dark);
    text-decoration: none;
    letter-spacing: 0.5px;
}

    .navbar-brand:hover {
        color: var(--primary-light);
        text-decoration: none;
    }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .navbar-nav a {
        color: var(--text-on-dark);
        padding: 8px 14px;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
        transition: var(--transition);
        text-decoration: none;
    }

        .navbar-nav a:hover,
        .navbar-nav a.active {
            background-color: rgba(255,255,255,0.15);
            color: var(--text-on-dark);
            text-decoration: none;
        }

.navbar-search input {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-pill);
    color: var(--text-on-dark);
    padding: 6px 16px;
    font-size: 0.875rem;
    width: 220px;
    outline: none;
    transition: var(--transition);
}

    .navbar-search input::placeholder {
        color: rgba(255,255,255,0.6);
    }

    .navbar-search input:focus {
        background: rgba(255,255,255,0.25);
        width: 260px;
    }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.footer {
    background-color: var(--bg-footer);
    color: rgba(255,255,255,0.85);
    padding: 20px 24px;
    text-align: center;
    font-size: 0.875rem;
    margin-top: 40px;
}

    .footer a {
        color: var(--primary-light);
    }

/* ---------------------------------------------------------------
   Cards
   --------------------------------------------------------------- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

    .card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.card-header {
    background-color: var(--primary);
    color: var(--text-on-dark);
    padding: 14px 18px;
    font-weight: 600;
}

.card-body {
    padding: 18px;
    color: var(--text-on-card);
}

.card-footer {
    background-color: var(--bg-hover);
    border-top: 1px solid var(--border-light);
    padding: 12px 18px;
}

/* Product Card */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .product-card:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-3px);
    }

    .product-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        background-color: var(--bg-hover);
    }

.product-card-body {
    padding: 14px;
    flex: 1;
    color: var(--text-on-card);
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.product-card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.product-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-price);
}

.product-card-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
}
.badge-outofstock {
    background: #fde8e8;
    color: #7a2828;
    border: 1px solid #f5b8b8;
}

.badge-lowstock {
    background: #fff3cd;
    color: #7a5c00;
    border: 1px solid #ffe08a;
}
/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

    .btn:hover {
        text-decoration: none;
    }

.btn-primary {
    background-color: var(--primary);
    color: var(--text-on-dark);
    border-color: var(--primary);
}

    .btn-primary:hover {
        background-color: var(--primary-dark);
        border-color: var(--primary-dark);
        color: var(--text-on-dark);
    }

.btn-accent {
    background-color: var(--accent);
    color: var(--text-on-dark);
    border-color: var(--accent);
}

    .btn-accent:hover {
        background-color: var(--accent-dark);
        color: var(--text-on-dark);
    }

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

    .btn-outline:hover {
        background-color: var(--primary);
        color: var(--text-on-dark);
    }

.btn-outline-accent {
    background-color: transparent;
    color: var(--accent-dark);
    border-color: var(--accent);
}

    .btn-outline-accent:hover {
        background-color: var(--accent);
        color: var(--text-on-dark);
    }

.btn-danger {
    background-color: var(--error);
    color: var(--text-on-dark);
    border-color: var(--error);
}

    .btn-danger:hover {
        background-color: #B05555;
        color: var(--text-on-dark);
    }

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}

    .form-control:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 3px rgba(91,143,168,0.15);
    }

    .form-control::placeholder {
        color: var(--text-muted);
    }

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 4px;
}

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

    .table th {
        background-color: var(--primary);
        color: var(--text-on-dark);
        padding: 12px 16px;
        text-align: left;
        font-weight: 600;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .table td {
        padding: 11px 16px;
        color: var(--text-on-card);
        border-bottom: 1px solid var(--border-light);
    }

    .table tr:last-child td {
        border-bottom: none;
    }

    .table tr:nth-child(even) td {
        background-color: var(--bg-table-alt);
    }

    .table tr:hover td {
        background-color: var(--bg-hover);
    }

/* ---------------------------------------------------------------
   Badges
   --------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    line-height: 1.4;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-accent {
    background-color: var(--accent-light);
    color: var(--accent-dark);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background-color: var(--error-bg);
    color: var(--error);
}

/* ---------------------------------------------------------------
   Alerts
   --------------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border-left: 4px solid transparent;
    margin-bottom: 16px;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border-left-color: var(--warning);
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error);
    border-left-color: var(--error);
}

.alert-info {
    background-color: var(--info-bg);
    color: var(--info);
    border-left-color: var(--info);
}

/* ---------------------------------------------------------------
   Hero Banner
   --------------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, #5B8FA8 0%, #4A7A5A 100%);
    color: var(--text-on-dark);
    padding: 60px 24px;
    text-align: center;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

    .hero h1 {
        color: var(--text-on-dark);
        font-size: 2.4rem;
        margin-bottom: 12px;
    }

    .hero p {
        color: rgba(255,255,255,0.90);
        font-size: 1.1rem;
        margin-bottom: 24px;
    }

/* ---------------------------------------------------------------
   Dashboard Metric Cards
   --------------------------------------------------------------- */
.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

    .metric-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.metric-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.metric-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.metric-card-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.metric-card.blue {
    border-left: 4px solid var(--primary);
}

.metric-card.green {
    border-left: 4px solid var(--accent);
}

.metric-card.amber {
    border-left: 4px solid var(--warning);
}

.metric-card.rose {
    border-left: 4px solid var(--error);
}

/* ---------------------------------------------------------------
   Grid helpers
   --------------------------------------------------------------- */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 16px;
    }

    .navbar-nav {
        gap: 4px;
    }

    .navbar-search input {
        width: 140px;
    }
}

/* ---------------------------------------------------------------
   Utility classes
   --------------------------------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-secondary);
}

.text-price {
    color: var(--text-price);
    font-weight: 700;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.p-1 {
    padding: 8px;
}

.p-2 {
    padding: 16px;
}

.p-3 {
    padding: 24px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.flex-wrap {
    flex-wrap: wrap;
}

.w-100 {
    width: 100%;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 20px 0;
}

/* ---------------------------------------------------------------
   Loading spinner
   --------------------------------------------------------------- */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------
   Blazor error UI
   --------------------------------------------------------------- */
#blazor-error-ui {
    background: var(--warning-bg);
    border-top: 2px solid var(--warning);
    bottom: 0;
    color: var(--warning);
    display: none;
    left: 0;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.875rem;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 16px;
        top: 10px;
    }
