/**
 * Mimico Territory Management - Design System
 * Centralized CSS variables and component styles for consistent theming
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Primary Colors - Green Theme */
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --primary-light: #4ade80;
    --primary-subtle: rgba(34, 197, 94, 0.1);
    
    /* Accent Colors */
    --accent: #14b8a6;
    --accent-dark: #0f766e;
    
    /* Status Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Neutral Colors */
    --text-main: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #1f2937;
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    /* Spacing Scale (4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 18px;
    --radius-2xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-primary: 0 12px 24px rgba(34, 197, 94, 0.35);
    
    /* Typography */
    --font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* ==================== Global Resets ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== Background Patterns ==================== */
.bg-gradient-green {
    background: 
        linear-gradient(rgba(220, 252, 231, 0.4), rgba(187, 247, 208, 0.4)), 
        url('hall.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.bg-gradient-overlay {
    background: 
        linear-gradient(135deg, var(--primary), var(--primary-light));
}

/* ==================== Glass Cards ==================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.glass-card-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-base);
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(34, 197, 94, 0.45);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

/* ==================== Form Inputs ==================== */
.input,
.textarea,
.select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-base);
    color: var(--text-main);
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ==================== Card Headers ==================== */
.card-header {
    padding: 36px 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    text-align: center;
}

.card-header h1,
.card-header h2,
.card-header h3 {
    font-weight: var(--font-bold);
    letter-spacing: -0.03em;
}

/* ==================== Navigation Elements ==================== */
.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-size-xl);
    transition: all var(--transition-base);
}

.back-button:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateX(-2px);
}

/* ==================== Footer ==================== */
.site-footer {
    margin-top: var(--space-8);
    text-align: center;
}

.site-footer a {
    text-decoration: none;
    font-weight: var(--font-semibold);
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(5px);
    transition: all var(--transition-base);
    display: inline-block;
}

.site-footer a:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* ==================== Notifications ==================== */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: var(--font-medium);
    color: white;
    opacity: 0;
    transform: translateY(-20px);
    transition: all var(--transition-slow);
    z-index: 999;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.notification.error {
    background: linear-gradient(135deg, var(--error), #dc2626);
}

/* ==================== Animations ==================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Utility Classes ==================== */
.container {
    max-width: 100%;
    width: 100%;
    padding: 0 var(--space-6);
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

/* ==================== Loading States ==================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ==================== Responsive Breakpoints ==================== */
@media (max-width: 640px) {
    :root {
        --font-size-3xl: 1.5rem;
        --font-size-4xl: 2rem;
    }
    
    .card-header {
        padding: 28px 24px;
    }
}
