/**
 * ================================================================
 * TARGET PARK DESIGN SYSTEM
 * ================================================================
 * 
 * A premium, modern design system for parking management.
 * Clean, professional aesthetics befitting Mercedes, Hilton, Hyatt clients.
 * 
 * Design Philosophy:
 * - Refined minimalism with strategic bold accents
 * - Premium automotive-inspired aesthetics  
 * - High contrast for outdoor kiosk readability
 * - Accessible, mobile-first responsive design
 */

/* ================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ================================================================ */

:root {
    /* Primary Brand Colors */
    --tp-black: #0a0a0a;
    --tp-white: #ffffff;
    --tp-red: #dc2626;
    --tp-red-dark: #b91c1c;
    --tp-red-light: #fecaca;
    
    /* Neutral Palette */
    --tp-gray-50: #fafafa;
    --tp-gray-100: #f4f4f5;
    --tp-gray-200: #e4e4e7;
    --tp-gray-300: #d4d4d8;
    --tp-gray-400: #a1a1aa;
    --tp-gray-500: #71717a;
    --tp-gray-600: #52525b;
    --tp-gray-700: #3f3f46;
    --tp-gray-800: #27272a;
    --tp-gray-900: #18181b;
    
    /* Semantic Colors */
    --tp-success: #16a34a;
    --tp-success-light: #dcfce7;
    --tp-warning: #ca8a04;
    --tp-warning-light: #fef9c3;
    --tp-error: #dc2626;
    --tp-error-light: #fee2e2;
    --tp-info: #0284c7;
    --tp-info-light: #e0f2fe;
    
    /* Typography */
    --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    
    /* Font Sizes (fluid typography) */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
    --text-5xl: clamp(3rem, 2rem + 5vw, 5rem);
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-tooltip: 500;
    --z-toast: 600;
    
    /* Container widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
}

/* Dark mode variables */
[data-theme="dark"] {
    --tp-bg: var(--tp-gray-900);
    --tp-bg-elevated: var(--tp-gray-800);
    --tp-text: var(--tp-gray-100);
    --tp-text-muted: var(--tp-gray-400);
    --tp-border: var(--tp-gray-700);
}

[data-theme="light"], :root {
    --tp-bg: var(--tp-white);
    --tp-bg-elevated: var(--tp-gray-50);
    --tp-text: var(--tp-gray-900);
    --tp-text-muted: var(--tp-gray-500);
    --tp-border: var(--tp-gray-200);
}


/* ================================================================
   RESET & BASE STYLES
   ================================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--tp-text);
    background-color: var(--tp-bg);
    min-height: 100vh;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}


/* ================================================================
   TYPOGRAPHY
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.text-display {
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.text-muted { color: var(--tp-text-muted); }
.text-small { font-size: var(--text-sm); }
.text-mono { font-family: var(--font-mono); }


/* ================================================================
   LAYOUT COMPONENTS
   ================================================================ */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .container { padding: 0 var(--space-6); }
}

.container-narrow {
    max-width: var(--container-md);
}

.container-wide {
    max-width: var(--container-2xl);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-4);
}

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

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }


/* ================================================================
   NAVIGATION
   ================================================================ */

.tp-navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--tp-black);
    color: var(--tp-white);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--tp-gray-800);
}

.tp-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tp-navbar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
}

.tp-navbar-logo svg {
    width: 32px;
    height: 32px;
}

.tp-navbar-logo span {
    color: var(--tp-red);
}

.tp-navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.tp-navbar-link {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--tp-gray-300);
    transition: color var(--transition-fast);
}

.tp-navbar-link:hover {
    color: var(--tp-white);
}

.tp-navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile menu toggle */
.tp-navbar-toggle {
    display: none;
    padding: var(--space-2);
    background: none;
    border: none;
    color: var(--tp-white);
    cursor: pointer;
}

@media (max-width: 768px) {
    .tp-navbar-nav {
        display: none;
    }
    
    .tp-navbar-toggle {
        display: block;
    }
    
    .tp-navbar-nav.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--tp-black);
        padding: var(--space-4);
        border-top: 1px solid var(--tp-gray-800);
    }
}


/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

/* Primary Button */
.btn-primary {
    background: var(--tp-black);
    color: var(--tp-white);
    border-color: var(--tp-black);
}

.btn-primary:hover:not(:disabled) {
    background: var(--tp-gray-800);
}

/* Secondary Button */
.btn-secondary {
    background: var(--tp-white);
    color: var(--tp-black);
    border-color: var(--tp-gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--tp-gray-100);
    border-color: var(--tp-gray-400);
}

/* Danger Button */
.btn-danger {
    background: var(--tp-red);
    color: var(--tp-white);
    border-color: var(--tp-red);
}

.btn-danger:hover:not(:disabled) {
    background: var(--tp-red-dark);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--tp-text);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--tp-gray-100);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

/* Button with icon */
.btn-icon {
    padding: var(--space-3);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}


/* ================================================================
   CARDS
   ================================================================ */

.card {
    background: var(--tp-bg);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-elevated {
    background: var(--tp-bg-elevated);
    box-shadow: var(--shadow-lg);
    border: none;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--tp-border);
}

.card-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    background: var(--tp-bg-elevated);
    border-top: 1px solid var(--tp-border);
}

/* Interactive card */
.card-interactive {
    cursor: pointer;
    transition: all var(--transition-base);
}

.card-interactive:hover {
    border-color: var(--tp-gray-400);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}


/* ================================================================
   FORM ELEMENTS
   ================================================================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--tp-text);
}

.form-label-required::after {
    content: '*';
    color: var(--tp-red);
    margin-left: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    background: var(--tp-bg);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--tp-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

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

.form-input-error {
    border-color: var(--tp-error);
}

.form-input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-help {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--tp-text-muted);
}

.form-error {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--tp-error);
}

/* Input with icon */
.form-input-wrapper {
    position: relative;
}

.form-input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--tp-gray-400);
}

.form-input-wrapper .form-input {
    padding-left: calc(var(--space-4) + 24px + var(--space-2));
}

/* Checkbox & Radio */
.form-checkbox,
.form-radio {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}

.form-checkbox input,
.form-radio input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--tp-black);
}


/* ================================================================
   TABLES
   ================================================================ */

.table-container {
    overflow-x: auto;
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--tp-border);
}

.table th {
    background: var(--tp-bg-elevated);
    font-weight: var(--font-semibold);
    color: var(--tp-text);
    white-space: nowrap;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: var(--space-2);
}


/* ================================================================
   BADGES
   ================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
}

.badge-gray {
    background: var(--tp-gray-100);
    color: var(--tp-gray-700);
}

.badge-success {
    background: var(--tp-success-light);
    color: var(--tp-success);
}

.badge-warning {
    background: var(--tp-warning-light);
    color: var(--tp-warning);
}

.badge-error {
    background: var(--tp-error-light);
    color: var(--tp-error);
}

.badge-info {
    background: var(--tp-info-light);
    color: var(--tp-info);
}


/* ================================================================
   ALERTS
   ================================================================ */

.alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.alert-success {
    background: var(--tp-success-light);
    color: var(--tp-success);
    border: 1px solid var(--tp-success);
}

.alert-warning {
    background: var(--tp-warning-light);
    color: var(--tp-warning);
    border: 1px solid var(--tp-warning);
}

.alert-error {
    background: var(--tp-error-light);
    color: var(--tp-error);
    border: 1px solid var(--tp-error);
}

.alert-info {
    background: var(--tp-info-light);
    color: var(--tp-info);
    border: 1px solid var(--tp-info);
}


/* ================================================================
   STAT CARDS
   ================================================================ */

.stat-card {
    background: var(--tp-bg);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.stat-card-dark {
    background: var(--tp-black);
    color: var(--tp-white);
    border: none;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--tp-text-muted);
    margin-bottom: var(--space-2);
}

.stat-card-dark .stat-label {
    color: var(--tp-gray-400);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.stat-change-up {
    color: var(--tp-success);
}

.stat-change-down {
    color: var(--tp-error);
}


/* ================================================================
   PROGRESS INDICATORS
   ================================================================ */

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--tp-gray-200);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    z-index: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tp-gray-200);
    color: var(--tp-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    transition: all var(--transition-base);
}

.progress-step.active .progress-step-circle,
.progress-step.completed .progress-step-circle {
    background: var(--tp-black);
    color: var(--tp-white);
}

.progress-step.completed .progress-step-circle {
    background: var(--tp-success);
}

.progress-step-label {
    font-size: var(--text-sm);
    color: var(--tp-text-muted);
    text-align: center;
}

.progress-step.active .progress-step-label {
    color: var(--tp-text);
    font-weight: var(--font-medium);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--tp-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--tp-black);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}


/* ================================================================
   MODAL
   ================================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--tp-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--tp-border);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    background: var(--tp-bg-elevated);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}


/* ================================================================
   LOADING STATES
   ================================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--tp-gray-200) 0%,
        var(--tp-gray-100) 50%,
        var(--tp-gray-200) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--tp-gray-200);
    border-top-color: var(--tp-black);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

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


/* ================================================================
   UTILITY CLASSES
   ================================================================ */

/* Spacing */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Visibility */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fadeIn {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slideUp {
    animation: slideUp var(--transition-slow) ease-out;
}

.animate-slideDown {
    animation: slideDown var(--transition-slow) ease-out;
}

/* Staggered animations */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
