/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.nav-links a:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.nav-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.nav-text {
    font-size: 0.95rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

/* Distance Form */
.distance-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-icon {
    font-size: 1.2em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.swap-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.swap-btn:hover {
    background: #5a6fd8;
    transform: rotate(180deg);
}

.calculate-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.calculate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Suggestions */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    color: #333;
    background: white;
}

.suggestion-item:hover {
    background: #667eea;
    color: white;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item small {
    display: block;
    margin-top: 4px;
    opacity: 0.8;
}

.suggestion-item:hover small {
    color: rgba(255, 255, 255, 0.8);
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    background: #f8fafc;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Popular Routes */
.popular-routes {
    padding: 4rem 0;
    background: #f8fafc;
}

.popular-routes h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.route-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.route-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.route-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.route-info p {
    color: #666;
    font-size: 0.9rem;
}

.route-arrow {
    font-size: 1.5rem;
    color: #667eea;
}

/* Distance Result Page */
.distance-result {
    padding: 2rem 0;
    background: white;
}

.result-header {
    text-align: center;
    margin-bottom: 3rem;
}

.result-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.breadcrumb {
    color:white;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.result-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.distance-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.distance-main {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
}

.distance-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    flex: 1;
    min-width: 250px;
}

.distance-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.distance-unit {
    font-size: 1.2rem;
    opacity: 0.8;
}

.distance-conversions {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.conversion {
    text-align: center;
}

.conversion-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
}

.conversion-unit {
    font-size: 0.9rem;
    opacity: 0.8;
}

.distance-details {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.detail-label {
    opacity: 0.8;
}

.detail-value {
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

/* Driving distance styling */
.distance-value.driving {
    border-left: 4px solid #28a745;
    padding-left: 1rem;
    margin-left: 1rem;
}

.distance-type {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    font-weight: normal;
}

.conversion.driving {
    border-left: 3px solid #28a745;
    padding-left: 0.5rem;
}

/* Map Container */
.map-container h3 {
    margin-bottom: 1rem;
    color: #333;
}

.map {
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Result Actions */
.result-actions {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin: 0 0.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8fafc;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Additional Info */
.additional-info {
    padding: 3rem 0;
    background: #f8fafc;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.coordinates p, .time-estimates p {
    margin-bottom: 0.5rem;
}

.time-estimates small {
    color: #666;
    font-style: italic;
}

/* Related Calculations */
.related-calculations {
    padding: 3rem 0;
    background: white;
}

.related-calculations h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.related-link {
    display: block;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
}

.related-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* About Section */
.about {
    padding: 4rem 0;
    background: white;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 3rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
}

.about-feature h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.about-feature p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #ccc;
    font-size: 0.9rem;
}

/* Distance Overview Section */
.distance-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
}

.overview-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.breadcrumb {
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0.9;
}


.breadcrumb a:hover {
    color: white;
}

.quick-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.fact-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.fact-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.fact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.fact-content {
    display: flex;
    flex-direction: column;
}

.fact-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.fact-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Location Descriptions Section */
.location-descriptions {
    padding: 3rem 0;
    background: white;
}

.location-descriptions h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.descriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.description-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.description-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.description-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.description-card p {
    line-height: 1.7;
    color: #555;
}

/* FAQ Section */
.faq-section {
    padding: 3rem 0;
    background: #f8fafc;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.faq-item h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.faq-item p {
    line-height: 1.7;
    color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-divider {
        order: 3;
        margin: 0;
    }
    
    .swap-btn {
        transform: rotate(90deg);
    }
    
    
    .distance-conversions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .features-grid,
    .routes-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    
    .nav-icon {
        font-size: 0.9rem;
    }
    
    .nav-text {
        font-size: 0.75rem;
    }
    
    .overview-header h1 {
        font-size: 1.8rem;
    }
    
    .quick-facts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .fact-item {
        padding: 1rem;
    }
    
    .descriptions-grid,
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .description-card,
    .faq-item {
        padding: 1.5rem;
    }
    
    .distance-main {
        flex-direction: column;
        align-items: center;
    }
    
    .distance-value.driving {
        border-left: none;
        border-top: 3px solid #28a745;
        padding-left: 0;
        padding-top: 1rem;
        margin-left: 0;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .distance-form {
        padding: 1.5rem;
    }
    
    .distance-card {
        padding: 1.5rem;
    }
    
    .distance-number {
        font-size: 2rem;
    }
    
    .btn {
        display: block;
        margin: 0.5rem 0;
    }
    
    .fact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .fact-icon {
        margin-bottom: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .header, .footer, .result-actions, .related-calculations {
        display: none;
    }
    
    .distance-result {
        padding: 0;
    }
    
    .map {
        height: 300px;
    }
}
