/* Elite Car Hire - CSS Variables and Styles */

:root {
    --primary-gold: #C5A253;
    --dark-gray: #333;
    --medium-gray: #ccc;
    --light-gray: #f5f5f5;
    --white: #fff;
    --text-color: #333;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    background: linear-gradient(to bottom, #000000 0%, #2d2d2d 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #e0e0e0;
}

/* Navigation */
.navbar {
    background: var(--dark-gray);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

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

.nav-brand h1 {
    color: var(--primary-gold);
    font-size: 1.8rem;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-gold);
}

.user-name {
    color: var(--primary-gold);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: #b89243;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.stat-card h2 {
    color: var(--primary-gold);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--dark-gray);
    font-size: 1rem;
}

/* Sidebar Layout */
.sidebar-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 250px;
    background: var(--light-gray);
    padding: 2rem 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
}

.sidebar ul li a {
    display: block;
    padding: 12px 24px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: var(--primary-gold);
    color: var(--white);
}

.main-content {
    flex: 1;
    padding: 2rem;
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--primary-gold);
    color: var(--white);
}

table th,
table td {
    padding: 15px;
    text-align: left;
}

table tbody tr {
    border-bottom: 1px solid var(--medium-gray);
}

table tbody tr:hover {
    background: var(--light-gray);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.vehicle-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s;
}

.vehicle-card:hover {
    transform: translateY(-5px);
}

.vehicle-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.vehicle-card-body {
    padding: 1.5rem;
}

.vehicle-card-body h3 {
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
.footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer h3 {
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--white);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-gold);
}

/* Notification Badges */
.notification-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar a .notification-badge {
    margin-left: auto;
}

/* Calendar Styles */
.booking-calendar {
    width: 100%;
    overflow-x: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--medium-gray);
    border: 1px solid var(--medium-gray);
    min-width: 700px;
}

.calendar-day-header {
    background: var(--primary-gold);
    color: var(--white);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-day {
    background: var(--white);
    min-height: 120px;
    padding: 0.5rem;
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day.empty {
    background: var(--light-gray);
}

.calendar-day.today {
    background: #fff9e6;
    border: 2px solid var(--primary-gold);
}

.calendar-day:hover:not(.empty) {
    background: #fafafa;
}

.day-number {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.bookings-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.booking-item {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    border-left: 3px solid;
}

.booking-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.booking-time {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.booking-info {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status-specific styles for calendar bookings */
.booking-item.status-pending {
    background: #f0f0f0;
    border-left-color: #6c757d;
    color: #495057;
}

.booking-item.status-confirmed {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.booking-item.status-in-progress {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.booking-item.status-completed {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.booking-item.status-cancelled {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* Status indicators for legend */
.status-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
}

.status-indicator.status-pending {
    background: #f0f0f0;
    border-color: #6c757d;
}

.status-indicator.status-confirmed {
    background: #d4edda;
    border-color: #28a745;
}

.status-indicator.status-in_progress {
    background: #fff3cd;
    border-color: #ffc107;
}

.status-indicator.status-completed {
    background: #d1ecf1;
    border-color: #17a2b8;
}

.status-indicator.status-cancelled {
    background: #f8d7da;
    border-color: #dc3545;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Bookings Calendar Styles */
.bookings-calendar-container {
    border: 1px solid #ccc;
    background: white;
    max-width: 50%;
    margin: 0 auto;
}

/* Responsive: Larger on tablets and smaller screens */
@media (max-width: 1024px) {
    .bookings-calendar-container {
        max-width: 70%;
    }
}

@media (max-width: 768px) {
    .bookings-calendar-container {
        max-width: 100%;
    }
}

#calendar {
    width: 100%;
    overflow-x: auto;
}

.bookings-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #d9d9d9;
    padding: 1rem 1.5rem;
}

.bookings-calendar-month {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #666;
}

.bookings-calendar-nav-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.bookings-calendar-nav-btn:hover {
    color: #333;
}

.calendar-grid-bookings {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    width: 100%;
    min-width: 700px;
}

.calendar-day-header-bookings {
    background: #f0f0f0;
    color: #666;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border: 1px solid #ccc;
}

.calendar-day-bookings {
    background: white;
    min-height: 100px;
    aspect-ratio: 1;
    padding: 0.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #ccc;
}

.calendar-day-bookings.empty {
    background: #f8f9fa;
    cursor: default;
    opacity: 0.5;
}

.calendar-day-bookings.today {
    box-shadow: inset 0 0 0 3px var(--primary-gold);
}

.calendar-day-bookings:not(.empty):hover {
    transform: scale(1.03);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.day-number-bookings {
    font-size: 1.8rem;
    font-weight: 700;
    color: #666;
}

.booking-count-badge {
    position: absolute;
    bottom: 0.3rem;
    right: 0.3rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Status-based colors for calendar days */
.calendar-day-bookings.status-available {
    background: white;
}

.calendar-day-bookings.status-available .day-number-bookings {
    color: #a0a0a0;
}

.calendar-day-bookings.status-booked {
    background: #dc3545;
}

.calendar-day-bookings.status-booked .day-number-bookings {
    color: #8b0000;
}

.calendar-day-bookings.status-pending {
    background: #f39c12;
}

.calendar-day-bookings.status-pending .day-number-bookings {
    color: #b8860b;
}

.calendar-day-bookings.status-completed {
    background: #6c757d;
}

.calendar-day-bookings.status-completed .day-number-bookings {
    color: #3d4246;
}

.calendar-day-bookings.status-blocked {
    background: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

.calendar-day-bookings.status-blocked .day-number-bookings {
    color: #868e96;
    text-decoration: line-through;
}

.calendar-day-bookings.status-blocked:hover {
    transform: none;
    box-shadow: none;
}

/* Conflict Status - Flashing Animation for Booking/Blocked Conflicts */
.calendar-day-bookings.status-conflict {
    background: #ff4444;
    cursor: pointer;
    animation: conflictFlash 1.5s ease-in-out infinite;
    border: 3px solid #cc0000;
}

.calendar-day-bookings.status-conflict .day-number-bookings {
    color: #ffffff;
    font-weight: 900;
}

.calendar-day-bookings.status-conflict:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4);
}

.conflict-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.5rem;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes conflictFlash {
    0%, 100% {
        background: #ff4444;
        border-color: #cc0000;
    }
    50% {
        background: #ff8888;
        border-color: #ff4444;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

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

    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }

    .calendar-day {
        min-height: 100px;
        font-size: 0.85rem;
    }

    .booking-item {
        font-size: 0.7rem;
        padding: 0.25rem 0.35rem;
    }

    .calendar-day-header {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .calendar-day-header-bookings {
        font-size: 0.75rem;
        padding: 0.75rem 0.25rem;
    }

    .calendar-day-bookings {
        min-height: 70px;
        padding: 0.25rem;
    }

    .day-number-bookings {
        font-size: 1.2rem;
    }

    .booking-count-badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.25rem;
    }

    .bookings-calendar-header {
        padding: 0.75rem 1rem;
    }

    .bookings-calendar-month {
        font-size: 1.2rem;
    }

    .bookings-calendar-nav-btn {
        font-size: 1.2rem;
        padding: 0.25rem 0.5rem;
    }
}
