/* General Styles */
:root {
    --primary-color: #0000FF; /* Blue */
    --secondary-color: #ffd700; /* Orange */
    --text-color: #333;
    --light-gray: #f8f8f8;
    --dark-gray: #555;
    --white: #fff;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 1em;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; }
h3 { font-size: 1.8em; }

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background-color: #003d33; /* Darker shade of primary-color */
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-login {
    background-color: transparent;
    color: var(--primary-color);
    padding: 8px 15px;
}
.btn-register {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 8px 15px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1em;
}

.section-spacing {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-gray);
}

.bg-dark {
    background-color: var(--primary-color);
}

.text-white {
    color: var(--white);
}

.text-center {
    text-align: center;
}

/* Header */
.main-header {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.main-header .logo {
    font-size: 1.8em;
    font-weight: bold;
}

.main-header .logo a {
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--dark-gray);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after {
    width: 100%;
    left: 0;
    background: var(--secondary-color);
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8em;
    color: var(--primary-color);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: url('../images/hero-bg.jpg') no-repeat center center/cover;
    color: var(--white);
    padding: 150px 0;
    text-align: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Overlay for readability */
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: var(--white);
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.3em;
    margin-bottom: 40px;
}

.booking-form-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    color: var(--text-color);
}

.booking-form-card h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.booking-form-card .form-group {
    margin-bottom: 20px;
}

.booking-form-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-gray);
}

.booking-form-card input[type="text"],
.booking-form-card input[type="number"],
.booking-form-card select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
}

.booking-form-card button[type="submit"] {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
}

/* Why Choose Us Section */
.why-choose-us .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-item h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Our Fleet Section */
.our-fleet .fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.car-category-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease;
}

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

.car-category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.car-category-card h3 {
    margin: 15px 0 10px;
    color: var(--primary-color);
}

.car-category-card p {
    padding: 0 15px 15px;
    font-size: 0.95em;
    color: var(--dark-gray);
}

.car-category-card .btn {
    margin-bottom: 20px;
}

/* Testimonials Section */
.testimonials .testimonial-carousel {
    display: flex;
    justify-content: center;
    gap: 30px; /* For multiple cards display */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.testimonial-item {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 500px;
    text-align: center;
}

.testimonial-item p {
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.8;
}

.testimonial-item h4 {
    color: var(--primary-color);
    font-weight: 600;
}

/* Call to Action Section */
.call-to-action {
    padding: 100px 0;
    background-color: var(--primary-color);
}

.call-to-action h2 {
    color: var(--white);
    margin-bottom: 20px;
}

.call-to-action p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--white);
    opacity: 0.9;
}

/* Footer */
.main-footer {
    background-color: #222;
    color: var(--white);
    padding: 60px 0 30px;
}

.main-footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
}

.footer-col p, .footer-col ul li {
    font-size: 0.95em;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
}

.footer-col.contact-info p i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.social-media a {
    display: inline-block;
    font-size: 1.5em;
    color: var(--white);
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 5px;
}

/* Styles for results.php */
.search-results-section .container {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 30px;
}

.filter-sidebar {
    flex: 0 0 250px; /* Fixed width sidebar */
    background-color: #fff;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.filter-sidebar h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.filter-group {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group h4 {
    font-size: 1.1em;
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: normal;
    color: var(--text-color);
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    margin-right: 10px;
}

.filter-group .slider {
    width: 100%;
    margin-top: 10px;
}

.filter-group p {
    margin-top: 10px;
    font-size: 0.95em;
    color: var(--dark-gray);
}

.car-listings {
    flex: 1; /* Takes remaining space */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.car-listing-item {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.car-listing-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.car-listing-item .car-info {
    padding: 20px;
    flex-grow: 1; /* Allows info section to grow */
    display: flex;
    flex-direction: column;
}

.car-listing-item .car-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.car-listing-item .car-info p {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: var(--dark-gray);
}

.car-listing-item .car-price {
    margin-top: auto; /* Pushes price to bottom */
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: 15px;
}

.car-listing-item .car-price strong {
    font-size: 1.3em;
    color: var(--primary-color);
}

.car-listing-item .btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
}

.no-results {
    text-align: center;
    width: 100%;
    font-size: 1.2em;
    color: var(--dark-gray);
    padding: 50px;
}

/* Styles for car-detail.php */
.car-detail-section .container {
    padding: 40px 20px;
}

.car-detail-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
}

@media (min-width: 992px) {
    .car-detail-content {
        flex-direction: row;
    }
}

.car-images {
    flex: 1;
    min-width: 300px;
}

.car-images img {
    width: 100%;
    border-radius: var(--border-radius);
    object-fit: cover;
    height: auto;
    max-height: 400px; /* Limit image height */
}

.car-info-details {
    flex: 2;
    padding-left: 20px;
}

.car-info-details h1 {
    margin-top: 0;
    font-size: 2.5em;
    color: var(--primary-color);
}

.car-info-details .car-tagline {
    font-size: 1.1em;
    color: var(--dark-gray);
    margin-bottom: 20px;
}

.car-specs p {
    margin-bottom: 10px;
    font-size: 1em;
    color: var(--text-color);
}

.car-specs i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.car-description {
    margin-top: 25px;
    margin-bottom: 30px;
    line-height: 1.7;
    color: var(--dark-gray);
}

.pricing-summary {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.pricing-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.pricing-summary ul {
    list-style: none;
    padding: 0;
}

.pricing-summary ul li {
    margin-bottom: 8px;
    font-size: 1.1em;
    color: var(--text-color);
}

.pricing-summary ul li strong {
    color: var(--primary-color);
}

.pricing-summary span {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--secondary-color);
}

.pricing-summary .price-note {
    font-size: 0.85em;
    color: var(--dark-gray);
    margin-top: 10px;
}

.booking-options .btn {
    width: auto;
    min-width: 200px;
    margin-right: 20px;
}

/* Styles for checkout.php */
.checkout-section .checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (min-width: 992px) {
    .checkout-section .checkout-grid {
        grid-template-columns: 1fr 2fr;
    }
}

.booking-summary-card, .payment-details-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.booking-summary-card h2, .payment-details-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.summary-item p {
    margin-bottom: 10px;
    font-size: 1em;
    color: var(--text-color);
}

.summary-total {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
    text-align: right;
}

.summary-total h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.8em;
    color: var(--primary-color);
}

.summary-total h3 span {
    color: var(--secondary-color);
}

.payment-details-card .form-group {
    margin-bottom: 15px;
}

.payment-details-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-gray);
}

.payment-details-card input[type="text"],
.payment-details-card input[type="email"],
.payment-details-card input[type="tel"],
.payment-details-card textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
}

.payment-details-card .payment-method-group label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: normal;
}

.payment-details-card .payment-method-group input[type="radio"] {
    margin-right: 10px;
    width: auto; /* Override 100% width */
}

.payment-details-card .row-group {
    display: flex;
    gap: 20px;
}

.payment-details-card .row-group .col {
    flex: 1;
}

.payment-details-card .privacy-policy label {
    font-size: 0.9em;
    font-weight: normal;
    color: var(--dark-gray);
}

.payment-details-card .privacy-policy a {
    color: var(--primary-color);
    text-decoration: underline;
}

.payment-details-card .btn-lg {
    width: 100%;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Hide navigation on smaller screens by default */
    }

    .main-header .container {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .main-header .logo, .auth-buttons {
        flex-basis: 100%;
        margin-bottom: 15px;
    }

    .main-nav.active {
        display: block;
        width: 100%;
        margin-top: 20px;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .menu-toggle {
        display: block;
        order: -1; /* Move to the left */
        margin-right: auto;
    }

    .hero-section {
        padding: 100px 0;
    }

    .hero-section h1 {
        font-size: 2.2em;
    }

    .hero-section p {
        font-size: 1.1em;
    }

    .booking-form-card {
        padding: 25px;
    }

    .why-choose-us .features-grid,
    .our-fleet .fleet-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .feature-item, .car-category-card, .testimonial-item {
        max-width: 450px;
        margin: 0 auto;
    }

    .search-results-section .container {
        flex-direction: column;
    }
    .filter-sidebar {
        flex: auto; /* Allow sidebar to take full width */
        max-width: none;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 10px 0;
    }

    .main-header .logo {
        font-size: 1.5em;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 5px;
    }

    .auth-buttons .btn {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .hero-section {
        padding: 80px 0;
    }

    .hero-section h1 {
        font-size: 1.8em;
    }

    .hero-section p {
        font-size: 1em;
    }

    .booking-form-card {
        padding: 20px;
    }

    h2 { font-size: 1.8em; }
    h3 { font-size: 1.5em; }

    .section-spacing {
        padding: 60px 0;
    }

    .call-to-action {
        padding: 80px 0;
    }

    .car-listings {
        grid-template-columns: 1fr;
    }

    .car-detail-content {
        padding: 20px;
    }
    .car-info-details {
        padding-left: 0;
    }
    .car-info-details h1 {
        font-size: 2em;
    }

    .checkout-section .checkout-grid {
        grid-template-columns: 1fr;
    }

    .payment-details-card .row-group {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .main-header .logo {
        font-size: 1.3em;
    }

    .hero-section h1 {
        font-size: 1.5em;
    }

    .hero-section p {
        font-size: 0.9em;
    }

    .booking-form-card {
        padding: 15px;
    }

    .booking-form-card .form-group {
        margin-bottom: 15px;
    }

    .booking-form-card input, .booking-form-card select {
        padding: 10px;
        font-size: 0.9em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    h2 { font-size: 1.6em; }
    h3 { font-size: 1.3em; }

    .feature-item, .car-category-card, .testimonial-item {
        padding: 20px;
    }
}

/* public/css/style.css */

/* ... โค้ด CSS ส่วนอื่นๆ ... */

/* Hero Section */
.hero-section {
    /* ตรวจสอบบรรทัดนี้ให้ดี */
    background: url('../images/hero-bg.jpg') no-repeat center center/cover;
    color: var(--white);
    padding: 150px 0;
    text-align: center;
    position: relative;
    min-height: 500px; /* เพิ่มความสูงขั้นต่ำเพื่อให้เห็นรูปชัดเจนขึ้น */
    display: flex;
    align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    justify-content: center; /* จัดให้อยู่กึ่งกลางแนวนอน */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Overlay เพื่อให้ข้อความอ่านง่ายขึ้น */
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* ... โค้ด CSS ส่วนอื่นๆ ... */
/* public/css/style.css */

/* ... โค้ด CSS ส่วนอื่นๆ ที่มีอยู่แล้ว ... */

/* --- Contact Page Specific Styles --- */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 60px;
    text-align: center;
}
.contact-item {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.contact-item i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.contact-item h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}
.contact-item p {
    font-size: 1em;
    color: var(--dark-gray);
}
.contact-form-section {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.contact-form-section h2 {
    text-align: center;
    margin-bottom: 30px;
}
.contact-form .form-group {
    margin-bottom: 20px;
}
.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-gray);
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
    box-sizing: border-box; /* สำคัญเพื่อให้ padding ไม่ขยายความกว้าง */
}
.contact-form button[type="submit"] {
    width: auto; /* ไม่จำเป็นต้องเต็มความกว้าง */
    padding: 12px 30px;
    font-size: 1.1em;
    display: block; /* ทำให้ปุ่มอยู่บรรทัดใหม่ */
    margin: 20px auto 0; /* จัดปุ่มให้อยู่กึ่งกลาง */
}

/* --- Responsive Adjustments for Contact Page --- */
@media (max-width: 768px) {
    .contact-info-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        gap: 20px;
        margin-top: 30px;
        margin-bottom: 40px;
    }
    .contact-item {
        padding: 25px;
    }
    .contact-form-section {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .contact-item {
        padding: 20px;
    }
    .contact-form-section {
        padding: 20px;
    }
    .contact-form button[type="submit"] {
        width: 100%; /* ทำให้ปุ่มเต็มความกว้างบนมือถือเล็ก */
    }
}