/* ===== Card Shop - Modern UI ===== */

:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5a4bd1;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --dark: #2d3436;
    --dark-light: #636e72;
    --gray: #b2bec3;
    --gray-light: #dfe6e9;
    --light: #f5f6fa;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Navbar ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 0 2rem;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.navbar-brand svg {
    width: 32px;
    height: 32px;
}

/* Sci-fi brand text effect + CRT glitch */
.brand-text {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 3px;
    background: linear-gradient(
        90deg,
        #fff 0%,
        #e0d4ff 15%,
        #00f0ff 30%,
        #fff 50%,
        #c8b6ff 70%,
        #00f0ff 85%,
        #fff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite, glitch-skew 1.8s infinite linear alternate-reverse;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3));
    position: relative;
}

/* Red channel ghost */
.brand-text::before {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    -webkit-text-fill-color: rgba(255, 0, 60, 0.5);
    background: none;
    z-index: -1;
    clip-path: inset(0 0 0 0);
    animation: glitch-red 1.8s infinite linear alternate-reverse;
}

/* Cyan channel ghost */
.brand-text::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    -webkit-text-fill-color: rgba(0, 240, 255, 0.5);
    background: none;
    z-index: -1;
    clip-path: inset(0 0 0 0);
    animation: glitch-cyan 1.8s infinite linear alternate-reverse;
}

.navbar-brand:hover .brand-text {
    filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.6));
    animation: shimmer 1.5s linear infinite, glitch-skew 0.8s infinite linear alternate-reverse;
}
.navbar-brand:hover .brand-text::before {
    animation: glitch-red 0.8s infinite linear alternate-reverse;
}
.navbar-brand:hover .brand-text::after {
    animation: glitch-cyan 0.8s infinite linear alternate-reverse;
}

@keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* Red ghost jitter - only activates at certain keyframes to mimic "bad signal" bursts */
@keyframes glitch-red {
    0%, 85%  { transform: translate(0); clip-path: inset(0 0 0 0); }
    86%      { transform: translate(-3px, -1px); clip-path: inset(10% 0 60% 0); }
    88%      { transform: translate(2px, 1px); clip-path: inset(40% 0 20% 0); }
    89%      { transform: translate(-1px, 0); clip-path: inset(70% 0 5% 0); }
    90%, 100%{ transform: translate(0); clip-path: inset(0 0 0 0); }
}

/* Cyan ghost jitter - offset timing from red for chaotic feel */
@keyframes glitch-cyan {
    0%, 88%  { transform: translate(0); clip-path: inset(0 0 0 0); }
    89%      { transform: translate(3px, 1px); clip-path: inset(20% 0 50% 0); }
    91%      { transform: translate(-2px, -1px); clip-path: inset(55% 0 10% 0); }
    92%      { transform: translate(1px, 0); clip-path: inset(5% 0 80% 0); }
    93%, 100%{ transform: translate(0); clip-path: inset(0 0 0 0); }
}

/* Subtle skew jitter on the main text */
@keyframes glitch-skew {
    0%, 84%  { transform: skewX(0deg); }
    85%      { transform: skewX(-1deg); }
    86%      { transform: skewX(0.5deg); }
    87%      { transform: skewX(-0.3deg); }
    88%, 100%{ transform: skewX(0deg); }
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav a:hover, .navbar-nav a.active {
    color: var(--white);
    background: rgba(255,255,255,0.15);
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Language Selector ===== */
.lang-selector {
    position: relative;
}

.lang-btn {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.25);
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 1000;
    overflow: hidden;
}

.lang-menu.active {
    display: block;
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s;
}

.lang-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

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

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

.btn-outline-white {
    background: transparent;
    color: var(--white);
    border: 1.5px solid rgba(255,255,255,0.5);
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
    color: var(--white);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00a381);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #d63031);
    color: var(--white);
}

.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark-light);
}

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

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== Announcement ===== */
.announcement-card {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.announcement-card h4 {
    color: #856404;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.announcement-card p {
    color: #6d5200;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ===== Category Tabs ===== */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--white);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.category-tab {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    color: var(--dark-light);
    background: transparent;
    border: none;
}

.category-tab:hover {
    background: var(--light);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid transparent;
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--primary-light);
}

/* ===== Product Image ===== */
.product-card-image {
    display: block;
    width: 100%;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--light);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    gap: 6px;
}

.placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
}

.placeholder-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===== Compact Card Info ===== */
.product-card-info {
    padding: 0.9rem 1.1rem 1rem;
}

.product-card-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-name a {
    color: var(--dark);
    text-decoration: none;
}

.product-card-name a:hover {
    color: var(--primary);
}

.product-card-desc {
    font-size: 0.82rem;
    color: var(--dark-light);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-tags {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tag-deliver {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px;
    background: #fff4e6;
    color: #e8590c;
    border: 1px solid #ffe0b2;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.tag-manual {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.product-sold {
    font-size: 0.82rem;
    color: var(--dark-light);
    font-weight: 500;
}

.product-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.7rem;
    border-top: 1px solid var(--gray-light);
}

.product-price-compact {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--danger);
}

.product-price-compact span {
    font-size: 1.4rem;
    font-weight: 800;
}

.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, #ff6b35, #e8590c);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(232, 89, 12, 0.25);
}

.btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(232, 89, 12, 0.35);
    color: var(--white);
}

/* ===== Stock Status ===== */
.product-card-tags-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-lowstock {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.tag-soldout {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.btn-buy.btn-disabled {
    background: #b2bec3;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-buy.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Sold-out card */
.product-card.sold-out {
    opacity: 0.75;
}

.product-card.sold-out:hover {
    transform: none;
    border-color: transparent;
}

.sold-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Legacy detail page styles */
.product-card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 1.2rem 1.5rem;
    color: var(--white);
}

.product-card-header.has-image {
    border-radius: 0;
}

.product-detail-image {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.product-detail-image img {
    width: 100%;
    display: block;
}

.product-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.product-card-header .category-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-card-body {
    padding: 1.5rem;
}

.product-description {
    color: var(--dark-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-description:empty {
    display: none;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.product-price small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--dark-light);
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--dark-light);
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.stock-dot.low {
    background: var(--warning);
}

.stock-dot.empty {
    background: var(--danger);
}

.product-stats {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
    font-size: 0.8rem;
    color: var(--dark-light);
}

/* ===== Card (Generic) ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 1.5rem;
}

/* ===== Query Divider ===== */
.query-divider {
    display: flex;
    align-items: center;
    margin: 0.8rem 0;
    color: var(--dark-light);
    font-size: 0.85rem;
    font-weight: 500;
}

.query-divider::before,
.query-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-light);
}

.query-divider span {
    padding: 0 1rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark);
}

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

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

select.form-control {
    cursor: pointer;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ===== Order Page ===== */
.order-card {
    max-width: 600px;
    margin: 2rem auto;
}

.order-status {
    text-align: center;
    padding: 2rem;
}

.order-status .status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.status-pending .status-icon {
    background: #fff3cd;
    color: #856404;
}

.status-paid .status-icon {
    background: #d4edda;
    color: #155724;
}

.order-info {
    padding: 1.5rem;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.95rem;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-row .label {
    color: var(--dark-light);
    font-weight: 500;
}

.order-info-row .value {
    font-weight: 600;
    color: var(--dark);
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.card-content-box {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    margin: 1rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
    position: relative;
}

.card-content-box .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--dark-light);
    font-size: 0.9rem;
}

.auth-body {
    padding: 1rem 2rem 2rem;
}

.auth-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background: var(--light);
    font-size: 0.9rem;
    color: var(--dark-light);
}

/* ===== Admin ===== */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.admin-sidebar-nav {
    list-style: none;
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--dark-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-sidebar-nav a:hover, .admin-sidebar-nav a.active {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
    border-left-color: var(--primary);
}

.admin-sidebar-nav a svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}

.admin-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--dark-light);
    font-weight: 500;
}

.stat-card:nth-child(2) .stat-value { color: var(--success); }
.stat-card:nth-child(3) .stat-value { color: var(--secondary); }
.stat-card:nth-child(4) .stat-value { color: var(--accent); }
.stat-card:nth-child(5) .stat-value { color: var(--warning); }
.stat-card:nth-child(6) .stat-value { color: var(--danger); }

/* ===== Table ===== */
.table-wrapper {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--light);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
}

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

table tr:hover td {
    background: rgba(108, 92, 231, 0.02);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
}

/* ===== Alert ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--dark-light);
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar-inner {
        padding: 0 1rem;
    }

    .container {
        padding: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        padding: 0.5rem 0;
    }

    .admin-sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0 1rem;
    }

    .admin-sidebar-nav a {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 16px;
    }

    .admin-sidebar-nav a.active {
        border-bottom-color: var(--primary);
        border-left-color: transparent;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ===== Quantity input ===== */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}

.quantity-control button {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--light);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--dark);
    transition: var(--transition);
}

.quantity-control button:hover {
    background: var(--primary);
    color: var(--white);
}

.quantity-control input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--dark-light);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-light);
    padding: 0 4px;
}

.modal-body {
    padding: 1.5rem;
}

/* ===== Product Detail Section ===== */
.product-detail-section {
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.product-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.8rem 1.2rem;
    background: var(--light);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    border-bottom: 1px solid var(--gray-light);
}

.product-detail-title svg {
    color: var(--primary);
    flex-shrink: 0;
}

.product-detail-content {
    padding: 1.2rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--dark);
    word-break: break-word;
}

.product-detail-content p {
    margin-bottom: 0.8rem;
}

.product-detail-content p:last-child {
    margin-bottom: 0;
}

.product-detail-content ul,
.product-detail-content ol {
    margin: 0.5rem 0 0.8rem 1.5rem;
}

.product-detail-content li {
    margin-bottom: 0.3rem;
}

.product-detail-content h1,
.product-detail-content h2,
.product-detail-content h3,
.product-detail-content h4 {
    margin: 1rem 0 0.5rem;
    color: var(--dark);
}

.product-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
}

.product-detail-content a {
    color: var(--primary);
    text-decoration: underline;
}

.product-detail-content blockquote {
    border-left: 3px solid var(--primary-light);
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    background: var(--light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--dark-light);
}

.product-detail-content code {
    background: var(--light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--danger);
}

.product-detail-content pre {
    background: var(--dark);
    color: #f8f8f2;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 0.5rem 0;
}

.product-detail-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.product-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.product-detail-content table th,
.product-detail-content table td {
    border: 1px solid var(--gray-light);
    padding: 8px 12px;
    text-align: left;
}

.product-detail-content table th {
    background: var(--light);
    font-weight: 600;
}

.product-detail-content hr {
    border: none;
    border-top: 1px solid var(--gray-light);
    margin: 1rem 0;
}

/* ===== Dark Theme Variables ===== */
[data-theme="dark"] {
    --primary: #8e7ffe;
    --primary-light: #a29bfe;
    --primary-dark: #6c5ce7;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    
    /* Inverted Colors */
    --dark: #f5f6fa;
    --dark-light: #dfe6e9;
    --gray: #636e72;
    --gray-light: #444c50;
    --light: #1e1e24;
    --white: #2d3436;
    
    --shadow: 0 4px 15px rgba(0,0,0,0.4);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.6);
}

[data-theme="dark"] .table tr:hover {
    background-color: #3b4245; /* Darker hover */
}

[data-theme="dark"] .form-control {
    background-color: var(--light);
    color: var(--dark);
    border-color: var(--gray-light);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--white);
    border-color: var(--primary);
}

[data-theme="dark"] .btn-outline-white {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}

[data-theme="dark"] .btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}
