/* Modern App.css - Complete Overhaul */

/* Import fresh, modern font combinations */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* Modern Color System */
:root {
    /* Primary colors - Enhanced contrast blue */
    --primary: #0d47a1; /* Darker blue for better contrast */
    --primary-light: #1565c0;
    --primary-dark: #072e6e;
    /* Secondary colors - Vibrant coral */
    --secondary: #e53935; /* More contrast for secondary */
    --secondary-light: #f44336;
    --secondary-dark: #c62828;
    /* Accent color - Fresh mint with better contrast */
    --accent: #00897b;
    /* Status colors with improved contrast */
    --success: #2e7d32;
    --warning: #ef6c00;
    --danger: #c62828;
    /* Neutral tones - Clean and crisp */
    --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;
    /* Text colors */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-700); /* Darker for better readability */
    --text-tertiary: var(--gray-600);
    /* Spacing system */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    /* Enhanced shadows for depth */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    /* Typography scale */
    --h1-size: 2.5rem;
    --h2-size: 2rem;
    --h3-size: 1.75rem;
    --h4-size: 1.5rem;
    --h5-size: 1.25rem;
    --h6-size: 1rem;
    /* Spacing units */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;
    /* TimePicker styling */
    --tp-background-color: #fff;
    --tp-accent-color: var(--bs-primary);
    --tp-hour-color: var(--bs-secondary);
    --tp-minute-color: var(--bs-secondary);
}

/* Base styling */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--gray-50);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-md);
    color: var(--gray-900);
}

h1 {
    font-size: var(--h1-size);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.5px; /* Tighter letter spacing for headings */
}

h2 {
    font-size: var(--h2-size);
    margin-bottom: var(--space-md);
    letter-spacing: -0.3px;
}

h3 {
    font-size: var(--h3-size);
}

h4 {
    font-size: var(--h4-size);
}

h5 {
    font-size: var(--h5-size);
}

h6 {
    font-size: var(--h6-size);
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    line-height: 1.7; /* Improved line height for readability */
}

/* Links and buttons */
a, .btn-link {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

    a:hover, .btn-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* Enhanced button styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    padding: 0.7rem 1.8rem; /* More generous padding */
    font-weight: 600; /* Bolder text for better contrast */
    transition: var(--transition-normal);
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.01em; /* Slight letter spacing for better readability */
    position: relative;
    overflow: hidden;
}

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

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

    /* Button with icon alignment */
    .btn i, .btn svg {
        margin-right: 0.5rem;
        font-size: 1.1em;
    }

/* Button variants with enhanced contrast */
.btn-primary {
    background-color: var(--primary); /* Using our new darker blue */
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(13, 71, 161, 0.2); /* Subtle shadow for depth */
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:active {
        background-color: var(--primary-dark);
        color: white;
        box-shadow: 0 5px 15px rgba(13, 71, 161, 0.3);
    }

/* For buttons in navigation */
.nav-link.auth-btn {
    background-color: var(--primary);
    color: white !important;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.2rem;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(13, 71, 161, 0.2);
}

    .nav-link.auth-btn:hover {
        background-color: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(13, 71, 161, 0.3);
    }

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    box-shadow: 0 2px 10px rgba(229, 57, 53, 0.2);
}

    .btn-secondary:hover,
    .btn-secondary:focus {
        background-color: var(--secondary-dark);
        color: white;
        box-shadow: 0 5px 15px rgba(229, 57, 53, 0.3);
    }

.btn-accent {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 137, 123, 0.2);
}

    .btn-accent:hover {
        background-color: #00695c;
        box-shadow: 0 5px 15px rgba(0, 137, 123, 0.3);
    }

.btn-outline-primary {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        background-color: var(--primary);
        color: white;
        box-shadow: 0 4px 12px rgba(13, 71, 161, 0.2);
    }

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

/* Focus states */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.25);
    outline: none;
}

/* Global focus handling - removes default outline for mouse users but keeps for keyboard navigation */
:focus:not(:focus-visible) {
    outline: none;
}

/* Add this specific rule for your header */
header:focus,
.header:focus,
nav:focus {
    outline: none !important;
}

:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Content layout */
.content {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

/* Enhanced card component */
.card {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    border: none;
    transition: var(--transition-normal);
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.5rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.5rem 1.5rem;
}

/* Form elements */
.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    padding: 0.7rem 1rem;
    font-size: 1rem;
    transition: var(--transition-normal);
    background-color: var(--gray-50);
    width: 100%;
}

    .form-control:focus {
        border-color: var(--primary);
        background-color: white;
        box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.15);
    }

.form-label {
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--gray-700); /* Darker label for better contrast */
}

/* Improved floating label */
.form-floating {
    position: relative;
}

    .form-floating > .form-control {
        height: calc(3.5rem + 2px);
        padding: 1.5rem 0.75rem 0.5rem;
        line-height: 1.25;
    }

    .form-floating > label {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding: 1rem 0.75rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: none;
        border: 1px solid transparent;
        transform-origin: 0 0;
        transition: var(--transition-normal);
        color: var(--gray-500);
        font-size: 0.875rem;
    }

    .form-floating > .form-control:focus,
    .form-floating > .form-control:not(:placeholder-shown) {
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
    }

        .form-floating > .form-control:focus ~ label,
        .form-floating > .form-control:not(:placeholder-shown) ~ label {
            opacity: 0.9;
            transform: scale(0.85) translateY(-0.6rem);
            color: var(--primary);
            font-weight: 600;
        }

/* Tables */
.table {
    width: 100%;
    margin-bottom: var(--space-lg);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--gray-200);
}

    .table th {
        padding: 0.9rem 1.2rem;
        background-color: var(--gray-100);
        border-bottom: 2px solid var(--gray-200);
        text-align: left;
        font-weight: 600;
        color: var(--gray-700);
        text-transform: uppercase;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }

    .table td {
        padding: 1rem 1.2rem;
        border-bottom: 1px solid var(--gray-200);
        vertical-align: middle;
        color: var(--gray-800);
    }

    .table tbody tr {
        transition: var(--transition-fast);
        background-color: white;
    }

        .table tbody tr:hover {
            background-color: rgba(13, 71, 161, 0.05);
        }

/* Enhanced badge component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4em 0.8em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.badge-primary {
    background-color: rgba(13, 71, 161, 0.15);
    color: var(--primary);
}

.badge-secondary {
    background-color: rgba(229, 57, 53, 0.15);
    color: var(--secondary-dark);
}

.badge-success {
    background-color: rgba(46, 125, 50, 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(239, 108, 0, 0.15);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(198, 40, 40, 0.15);
    color: var(--danger);
}

/* Enhanced map markers */
.parking-marker {
    display: block;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
}

.marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary); /* Changed from #c30b82 to primary theme color */
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -16px 0 0 -16px;
    transition: all 0.3s ease;
}

    .marker-pin.available {
        background: var(--success);
    }

    .marker-pin.unavailable {
        background: var(--danger);
    }

    .marker-pin::after {
        content: '';
        width: 24px;
        height: 24px;
        margin: 4px 0 0 4px;
        background: #fff;
        position: absolute;
        border-radius: 50%;
    }

    .marker-pin:hover {
        transform: rotate(-45deg) scale(1.1);
    }

/* Refined marker styling for price display */
.marker-container {
    position: relative;
    width: 40px;
    height: 50px;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary); /* Changed from #4285F4 to primary theme color */
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -20px 0 0 -15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.marker-pin.available {
    background: var(--success); /* Using your theme color variable */
}

.marker-pin.unavailable {
    background: var(--gray-500);
}

.marker-pin::after {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    position: absolute;
    margin: 5px 0 0 5px;
}

.marker-price {
    position: absolute;
    width: 35px;
    top: 7px;
    left: 2.5px;
    color: #333;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 0 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Improve popup styling */
.leaflet-popup-content {
    min-width: 220px;
    padding: 5px;
}

.leaflet-popup-content .btn-primary,
.leaflet-popup .btn-primary {
    color: white !important;
}

/* Price tag styling in map popup */
.price-tag {
    font-weight: 600;
    color: #0d6efd;
    font-size: 1.1em;
    padding: 3px 6px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 4px;
    display: inline-block;
}

/* Enhanced location picker styling */
.location-search-input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

    .location-search-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.15);
    }

.location-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border: 1px solid var(--gray-300);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 1000;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

    .location-suggestions li {
        padding: 0.8rem 1.2rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .location-suggestions li:hover {
            background-color: rgba(13, 71, 161, 0.05);
        }

/* Improved leaflet controls */
.leaflet-control-geosearch form {
    width: 100%;
}

    .leaflet-control-geosearch form input {
        width: 100%;
        padding: 0.8rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--gray-300);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

/* Enhanced images with better handling */
img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Ensures images maintain aspect ratio while filling containers */
}

.img-fluid {
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .img-fluid:hover {
        transform: scale(1.01);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

/* Consistent styling for Back buttons */
.back-button-container {
    margin-bottom: 1.5rem;
}

    .back-button-container .btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

/* Animated progress indicators */
.spinner-border {
    animation-duration: 0.8s;
    border-width: 0.2em;
}

.loading-text {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    animation: pulse 2s infinite;
}

/* Quick Duration Buttons Styling */
.quick-duration-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-quick-duration {
    min-width: 48px;
    border-radius: 20px;
    background-color: #f0f4f8;
    border: 1px solid #e1e8ed;
    color: #495057;
    transition: all 0.2s ease;
    font-weight: 500;
}

    .btn-quick-duration:hover {
        background-color: #e9ecef;
        transform: translateY(-2px);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .btn-quick-duration.active {
        background-color: var(--bs-primary);
        color: white;
        border-color: var(--bs-primary);
    }

/* TimePicker styling */
.time-picker-input {
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    background-color: #fff;
}

/* Calendar Component Styling */
.calendar-container {
    margin-bottom: 2rem;
}

.calendar {
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: center;
}

.calendar-header > div {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 70px;
    border: 1px solid #e9ecef;
    padding: 5px;
    position: relative;
    overflow: hidden;
}

.other-month {
    background-color: #f8f9fa;
    color: #adb5bd;
}

.today {
    background-color: #e8f4f8;
    font-weight: bold;
}

.has-blocked-hours {
    background-color: #f8f8f8;
}

.blocked {
    background-color: #f5f5f5;
}

.day-number {
    font-weight: bold;
    position: absolute;
    top: 5px;
    left: 5px;
}

.day-status {
    position: absolute;
    top: 5px;
    right: 5px;
}

.day-actions {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
}

.action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
}

.legend > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive styles */
@media (max-width: 992px) {
    html {
        font-size: 15px;
    }

    .hero-section h1 {
        font-size: 2.8rem;
    }

    .btn-lg {
        padding: 0.8rem 1.8rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .hero-section {
        padding: 4rem 1.5rem;
    }

        .hero-section h1 {
            font-size: 2.5rem;
        }

        .hero-section .lead {
            font-size: 1.2rem;
        }

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

    .btn {
        padding: 0.7rem 1.5rem;
    }
    
    /* Calendar mobile optimizations */
    .calendar-day {
        min-height: 60px;
        padding: 2px;
    }

    .day-actions button {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .badge {
        font-size: 0.6rem;
        padding: 2px 4px;
    }

    .day-number {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 14px;
    }

    .hero-section {
        padding: 3rem 1rem;
    }

        .hero-section h1 {
            font-size: 2rem;
        }

        .hero-section .lead {
            font-size: 1.1rem;
        }

    .btn {
        padding: 0.6rem 1.2rem;
    }

    .form-control {
        padding: 0.6rem 0.9rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .card {
        padding: var(--space-md);
    }
    
    /* Calendar mobile optimizations for small screens */
    .calendar-day {
        min-height: 45px;
    }

    .day-actions button {
        width: 20px;
        height: 20px;
    }
}

#parkingMap {
    height: 400px;
    width: 100%;
    min-height: 400px; /* Ensure minimum height even if container sizing fails */
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Animation for page transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition {
    animation: fadeIn 0.4s ease-out;
}

/* QR code container styling */
.qr-code-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: inline-block;
    margin: 0 auto;
}

    .qr-code-container img {
        border-radius: var(--radius-sm);
    }
