/* Frontend Styles with Background Images */

:root {
    --primary-red: #dc2626;
    --primary-red-dark: #b91c1c;
    --secondary-black: #111827;
    --tertiary-white: #ffffff;
    --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;
}

/* Hero Section with Background Image */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/hero/bus-hero-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--white);
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-cta {
    display: inline-block;
    background: var(--primary-red);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.hero-cta:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
    color: var(--white);
}

/* Search Form Section */
.search-section {
    position: relative;
    z-index: 4;
    margin-top: -100px;
    padding: 0 2rem;
}

.search-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

.search-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
    text-align: center;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-control {
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.search-btn {
    grid-column: 1 / -1;
    background: var(--primary-red);
    color: var(--white);
    padding: 1.25rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.search-btn:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

/* Features Section */
.features-section {
    padding: 5rem 2rem;
    background: var(--gray-50);
    position: relative;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/backgrounds/features-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: 1;
}

.features-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.features-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 3rem;
}

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

.feature-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Services Section */
.services-section {
    padding: 5rem 2rem;
    background: var(--white);
    position: relative;
}

.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/backgrounds/services-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: 1;
}

.services-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.services-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 3rem;
}

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

.service-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.service-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.service-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(220, 38, 38, 0.8), rgba(17, 24, 39, 0.8));
}

.service-content {
    padding: 2rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.service-description {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-btn {
    background: var(--primary-red);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.service-btn:hover {
    background: var(--primary-red-dark);
    transform: translateY(-1px);
    color: var(--white);
}

/* Testimonials Section */
.testimonials-section {
    padding: 5rem 2rem;
    background: var(--gray-900);
    position: relative;
}

.testimonials-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/backgrounds/testimonials-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 1;
}

.testimonials-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.testimonials-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 3rem;
}

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

.testimonial-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.testimonial-text {
    color: var(--white);
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.testimonial-author {
    color: var(--white);
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    position: relative;
    text-align: center;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/backgrounds/cta-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: 1;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    color: var(--white);
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.cta-btn {
    background: var(--white);
    color: var(--primary-red);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-btn:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: var(--primary-red);
}

/* Additional Styles */
body {
    padding-top: 80px; /* Account for fixed navbar */
}


/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .features-title,
    .services-title,
    .testimonials-title,
    .cta-title {
        font-size: 2rem;
    }
    
    .features-grid,
    .services-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .search-card {
        padding: 1.5rem;
    }
    
    .hero-section {
        min-height: 80vh;
    }
    
    .search-section {
        margin-top: -50px;
    }
    
    body {
        padding-top: 70px;
    }
}

/* Modern Search Form Styles */
.search-section {
    padding: 2rem;
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    position: relative;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

/* City Select Styles */
.city-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.city-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23dc2626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/backgrounds/hero-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: 1;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.search-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    justify-content: space-between;
}

.form-field {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.form-field:nth-child(1) {
    flex: 0 0 200px;
}

.form-field:nth-child(3) {
    flex: 0 0 200px;
}

.form-field:nth-child(4) {
    flex: 0 0 180px;
}

.form-field:nth-child(5) {
    flex: 0 0 180px;
}

.search-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.form-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input {
    padding: 1rem 1.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input[readonly] {
    background: var(--gray-50);
    cursor: pointer;
}

.form-input[readonly]:hover {
    background: var(--gray-100);
}

/* Make text inputs look like readonly but be editable */
.form-input[name="origen"],
.form-input[name="destino"] {
    background: var(--gray-50);
    cursor: pointer;
}

.form-input[name="origen"]:hover,
.form-input[name="destino"]:hover {
    background: var(--gray-100);
}

.field-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 2;
}

.date-field {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input {
    padding-right: 3rem;
}

.calendar-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 2;
}

.swap-btn {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    flex: 0 0 48px;
    align-self: center;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.swap-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--white);
    transform: scale(1.1);
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn:active {
    transform: translateY(0);
}

.btn-text {
    font-weight: 600;
}

.btn-icon {
    font-size: 1.25rem;
}

/* Responsive Design for Search Form */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: auto auto auto;
        gap: 1rem;
    }
    
    .form-field:nth-child(4),
    .form-field:nth-child(5),
    .search-btn {
        grid-column: 1 / -1;
    }
    
    .swap-btn {
        grid-row: 1;
        grid-column: 2;
        align-self: center;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .search-section {
        padding: 1rem;
    }
    
    .search-card {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .swap-btn {
        grid-column: 1;
        grid-row: auto;
        align-self: center;
        margin: 0 auto;
    }
    
    .form-input {
        padding: 0.875rem 1rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.5rem;
        justify-content: center;
    }
}

/* Map Section Styles */
.map-section {
    padding: 2rem;
    background: var(--gray-100);
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.map-section:hover {
    border-color: var(--primary-red);
}

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

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

.map-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.map-toggle-btn {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.map-toggle-btn:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
}

.map-icon {
    font-size: 1.25rem;
}

/* Route Information Styles */
.route-info {
    margin-bottom: 2rem;
}

.route-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-red);
}

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

.route-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.route-distance {
    background: var(--primary-red);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.terminals-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.terminal {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.terminal-icon {
    font-size: 2rem;
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-details strong {
    display: block;
    font-size: 1.125rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.terminal-details p {
    color: var(--gray-600);
    margin: 0;
    font-size: 0.875rem;
}

.route-arrow {
    font-size: 1.5rem;
    color: var(--primary-red);
    font-weight: bold;
}

.map-wrapper {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.spain-map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
}

.map-instructions {
    text-align: center;
    margin-top: 1rem;
    color: var(--gray-600);
    font-style: italic;
}
