/* Commerce Suite - Dark Theme CSS */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --bg-hover: #1a3a5c;
    --accent: #00d4ff;
    --accent-hover: #00b8e6;
    --success: #4ade80;
    --success-dark: #065f46;
    --warning: #fbbf24;
    --error: #f87171;
    --error-dark: #991b1b;
    --text-primary: #eee;
    --text-secondary: #888;
    --border: #0f3460;
    --border-light: #1a4a7a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

.container-fluid {
    padding: 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

h1 {
    font-size: 1.75rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Navigation */
.app-nav {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    border-bottom: 1px solid var(--border);
}

.app-nav .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.app-nav .nav-links {
    display: flex;
    gap: 1.5rem;
}

.app-nav .nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.app-nav .nav-link:hover,
.app-nav .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.app-nav .nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.stat:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat--success .stat-value { color: var(--success); }
.stat--warning .stat-value { color: var(--warning); }
.stat--error .stat-value { color: var(--error); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    text-decoration: none;
}

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

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

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

.btn--success:hover {
    background: #22c55e;
}

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

.btn--danger {
    background: var(--error);
    color: #fff;
}

.btn--danger:hover {
    background: #ef4444;
}

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

.btn--ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.card-header:hover {
    background: var(--bg-hover);
}

.card-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.card-content {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.card.expanded {
    grid-column: 1 / -1;
}

.card.has-issues {
    border: 2px solid var(--error);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge--product { background: #3b82f6; }
.badge--collection { background: #10b981; }
.badge--banner { background: #f59e0b; }
.badge--active { background: var(--success); color: var(--bg-primary); }
.badge--draft { background: var(--warning); color: var(--bg-primary); }
.badge--archived { background: #6b7280; color: #fff; }
.badge--error { background: var(--error); color: #fff; }
.badge--success { background: var(--success); color: var(--bg-primary); }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.filter-tab .count {
    margin-left: 0.5rem;
    opacity: 0.7;
}

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

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-hover);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:hover {
    background: var(--bg-hover);
}

.table-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar-right {
    margin-left: auto;
}

/* Search */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success);
    background: var(--success-dark);
}

.toast.error {
    border-color: var(--error);
    background: var(--error-dark);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-primary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Score indicators */
.score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.score--a { background: var(--success); color: var(--bg-primary); }
.score--b { background: #84cc16; color: var(--bg-primary); }
.score--c { background: var(--warning); color: var(--bg-primary); }
.score--d { background: #f97316; color: #fff; }
.score--f { background: var(--error); color: #fff; }

/* Progress bar */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.progress-bar--success { background: var(--success); }
.progress-bar--warning { background: var(--warning); }
.progress-bar--error { background: var(--error); }

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

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

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

/* Error box */
.error-box {
    background: var(--error-dark);
    border: 1px solid var(--error);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

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

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

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .app-nav {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .app-nav .nav-links {
        width: 100%;
        overflow-x: auto;
    }
}
