/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Import Klavika font if available, fallback to system fonts */
@font-face {
    font-family: 'Klavika';
    src: local('Klavika-Regular'), local('Klavika');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* Adesso Brand Colors */
    --adesso-blue: #006ec7;
    --adesso-orange: #FF6600;

    /* Status Colors */
    --color-available: #10b981;
    --color-occupied: #ef4444;
    --color-your-spot: var(--adesso-blue);

    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-base: all 0.3s ease;
}

body {
    font-family: 'Klavika', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--color-gray-800);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--adesso-blue) 0%, #0056a3 100%);
    color: var(--color-white);
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Statistics Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-total .stat-value {
    color: var(--color-gray-700);
}

.stat-available .stat-value {
    color: var(--color-available);
}

.stat-occupied .stat-value {
    color: var(--color-occupied);
}

/* Parking Spots Grid */
.spots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.spot-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.spot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    transition: var(--transition-base);
}

.spot-card.available::before {
    background: var(--color-available);
}

.spot-card.occupied::before {
    background: var(--color-occupied);
}

.spot-card.your-spot::before {
    background: var(--adesso-blue);
}

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

.spot-card.occupied:not(.your-spot) {
    cursor: not-allowed;
    opacity: 0.7;
}

.spot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.spot-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
}

.spot-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spot-status.available {
    background: #d1fae5;
    color: #065f46;
}

.spot-status.occupied {
    background: #fee2e2;
    color: #991b1b;
}

.spot-status.your-spot {
    background: #dbeafe;
    color: #1e40af;
}

.spot-info {
    margin-bottom: 1rem;
}

.spot-reserved-by {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin-bottom: 0.25rem;
}

.spot-reserved-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-800);
}

.spot-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.spot-action {
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    font-size: 1rem;
    width: 100%;
    font-family: inherit;
}

.btn-primary {
    background: var(--adesso-blue);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #0056a3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.btn-secondary:hover {
    background: var(--color-gray-300);
}

.btn-danger {
    background: var(--color-occupied);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-text {
    background: none;
    border: none;
    color: var(--adesso-blue);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem;
    font-family: inherit;
}

.btn-text:hover {
    color: #0056a3;
}

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

/* User Info */
.user-info {
    background: var(--color-white);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 2rem;
}

.user-info strong {
    color: var(--adesso-blue);
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-gray-200);
    border-top: 4px solid var(--adesso-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Banners */
.error-banner,
.success-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 90%;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

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

.error-banner {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--color-occupied);
}

.success-banner {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--color-available);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    padding: 0;
    margin-left: 1rem;
    line-height: 1;
}

.close-btn:hover {
    opacity: 0.7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--color-white);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-gray-600);
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-800);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-gray-700);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition-base);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--adesso-blue);
    box-shadow: 0 0 0 3px rgba(0, 110, 199, 0.1);
}

/* Footer */
.footer {
    background: var(--color-gray-800);
    color: var(--color-white);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    opacity: 0.8;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.5rem;
    }

    .header-subtitle {
        font-size: 1rem;
    }

    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-value {
        font-size: 2rem;
    }

    .spots-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content {
        width: 95%;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 0;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .stats-dashboard {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .spot-card {
        padding: 1.5rem;
    }
}
