/**
 * Filament Management System - Styles
 */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --success: #16a34a;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

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

.nav-links a {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
}

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

h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.summary-card {
    text-align: center;
    padding: 1.25rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.card-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

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

.stat-list {
    list-style: none;
}

.stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.stat-list li:last-child {
    border-bottom: none;
}

.stat-list li.empty {
    color: var(--gray-400);
    font-style: italic;
}

.stat-count {
    color: var(--gray-500);
    font-size: 0.875rem;
}

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

.filament-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.filament-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.filament-color {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    flex-shrink: 0;
}

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

.filament-brand {
    font-weight: 600;
    color: var(--gray-900);
}

.filament-details {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.filament-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.filament-quantity {
    text-align: center;
    padding: 0 0.5rem;
}

.qty-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.qty-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

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

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

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

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

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-consume {
    background: var(--warning);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0;
}

.btn-consume:hover {
    background: #d97706;
    transform: scale(1.1);
}

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

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

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

.inventory-table th,
.inventory-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.inventory-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.inventory-table tbody tr:hover {
    background: var(--gray-50);
}

.inventory-table input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
    width: 100%;
    min-width: 80px;
}

.inventory-table input:focus {
    outline: none;
    border-color: var(--primary);
}

.inventory-table .qty-input {
    width: 60px;
    text-align: center;
}

.inventory-table tr.out-of-stock {
    opacity: 0.5;
    background: var(--gray-100);
}

.inventory-table tr.modified {
    background: #fef9c3;
}

.actions-cell {
    white-space: nowrap;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.table-actions.bottom {
    margin-top: 1rem;
    margin-bottom: 0;
}

.table-info {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Import Page */
.import-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.help-text {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.help-text ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.help-text pre {
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    overflow-x: auto;
}

/* Empty states */
.empty-message {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.empty-message a {
    color: var(--primary);
}

.page-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 1rem;
    }

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

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

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .import-options {
        grid-template-columns: 1fr;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn-consume,
    .actions-cell,
    .form-actions {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
