/**
 * SS Filtrs — Galvenais stils
 * Moderns, responsīvs dizains
 */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --secondary: #3498db;
    --secondary-dark: #2980b9;
    --success: #27ae60;
    --success-light: #d5f5e3;
    --danger: #e74c3c;
    --danger-light: #fadbd8;
    --warning: #f39c12;
    --warning-light: #fdebd0;
    --info: #17a2b8;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* === Navigation === */
.navbar {
    background: var(--primary);
    color: var(--white);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    color: var(--white) !important;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

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

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

.nav-user {
    margin-left: 10px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius);
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

/* === Main Content === */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
}

/* === Alerts === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-light); color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error { background: var(--danger-light); color: #c0392b; border: 1px solid #f5b7b1; }
.alert-warning { background: var(--warning-light); color: #b9770e; border: 1px solid #f9e79f; }
.alert-info { background: #d6eaf8; color: #2471a3; border: 1px solid #aed6f1; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: var(--transition);
}

.alert-close:hover { opacity: 1; }

/* === Cards === */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

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

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #219a52; color: var(--white); }

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

.btn-outline { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--secondary); color: var(--secondary); background: #f8f9ff; }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Forms === */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-label .required::after {
    content: ' *';
    color: var(--danger);
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

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

.form-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 4px;
}

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

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

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th {
    background: var(--gray-100);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tr:hover td {
    background: #fafbff;
}

.table .actions {
    white-space: nowrap;
    text-align: right;
}

.table .actions a {
    margin-left: 8px;
    font-size: 0.85rem;
}

/* === Hero / Landing === */
.hero {
    text-align: center;
    padding: 60px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    color: var(--gray-600);
    margin-bottom: 30px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Steps === */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.step-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--secondary);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.step-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* === Filters === */
.filter-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: var(--transition);
}

.filter-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

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

.filter-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.filter-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.filter-meta span {
    margin-right: 12px;
}

.filter-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active { background: var(--success-light); color: var(--success); }
.badge-inactive { background: var(--gray-200); color: var(--gray-500); }

.filter-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* === Toggle Switch === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gray-300);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

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

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Footer === */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.6);
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

/* === Pagination === */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
}

.page-link {
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--gray-700);
    background: var(--white);
    border: 1px solid var(--gray-300);
}

.page-link:hover,
.page-link.active {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 10px 20px 20px;
        gap: 2px;
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .nav-link {
        padding: 10px 14px;
        width: 100%;
    }
    
    .nav-user {
        margin: 10px 0 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .filter-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
    }
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}
