/* 
  ==============================================================
  CITYCELL PREMUIM DESIGN SYSTEM - CORE (MASTER REFORM 2026)
  ==============================================================
  This file is now the CORE orchestrator. 
  Specific logic has been modularized into /css/modules/
*/

/* --- 1. CORE VARIABLES --- */
:root {
    /* Main Colors */
    --primary: #2F76BD;
    --primary-dark: #255d94;
    --primary-soft: #eaf1f8;
    --primary-light: rgba(47, 118, 189, 0.1);

    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #FFD642;
    --dark: #0f172a;

    /* Neutral Palette */
    --text-main: #1e293b;
    --text-light: #64748b;
    --text-dark: #0f172a;
    --bg-body: #F1F5F9;
    --bg-card: #ffffff;
    --border: #e2e8f0;

    /* Elevation & Shapes */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 20px;
    --radius-md: 12px;

    /* Screen Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Branding */
    --gradient: linear-gradient(135deg, #2F76BD 0%, #1a4d80 100%);
    --brand-blue: #2F76BD;

    /* Specific UI Hooks */
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-input: #f8fafc;

    /* Spacing System (Premium Rule 2) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Micro-interactions (Premium Rule 3) */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. GLOBAL RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-dark);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

/* --- 3. COMMON BUTTON SYSTEM --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

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

.btn-primary:hover,
.btn-citycell-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 118, 189, 0.2);
}

.btn-citycell-primary {
    background: var(--gradient);
    border: none;
    box-shadow: 0 8px 16px rgba(47, 118, 189, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-light);
}

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

.btn:active {
    transform: scale(0.97);
}

.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-ghost.loading::after {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
}

/* --- PREMIUM PASTEL BADGES --- */
.badge-pastel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent; /* Prevents visual jumping */
}
.badge-pastel-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}
.badge-pastel-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.badge-pastel-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}
.badge-pastel-info {
    background-color: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}
.badge-pastel-neutral {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

/* --- 4. UTILITY OVERRIDES --- */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.gap-10 {
    gap: 10px;
}

/* 
   LEGACY OVERRIDES
   These rules handle the transition until all inline styles are removed.
*/
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* Final Specificity Fix for SweetAlert in CityCell */
.swal2-container {
    z-index: 30000 !important;
}