/* WC Toilet Finder - Mobile-First Responsive CSS */
/* Optimized for PageSpeed 100 and high user experience */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a73e8;
    margin: 0;
}

.logo span {
    font-size: 0.875rem;
    color: #666;
    margin-left: 0.5rem;
}

.main-nav {
    display: none;
}

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

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #1a73e8;
}

.language-selector {
    margin-left: auto;
}

.language-selector select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 0.875rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 50px;
    overflow: hidden;
}

#location-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-button {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background: #1557b0;
}

.location-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.location-button:hover {
    background: rgba(255,255,255,0.3);
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: #fff;
}

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

.feature-card {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.feature-card p {
    color: #666;
    font-size: 0.875rem;
}

/* Cities Section */
.popular-cities-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.popular-cities-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #333;
}

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

.city-card {
    display: block;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    color: #1a73e8;
}

.city-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.city-subtitle {
    font-size: 0.875rem;
    color: #666;
}

/* Longtail Keywords */
.longtail-keywords-section {
    padding: 4rem 0;
    background: #fff;
}

.longtail-keywords-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #333;
}

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

.keyword-link {
    display: block;
    background: #f0f8ff;
    color: #1a73e8;
    padding: 1rem;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e3f2fd;
}

.keyword-link:hover {
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26,115,232,0.2);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #333;
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-toggle {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1a73e8;
    transition: transform 0.3s ease;
}

.faq-answer {
    display: none;
    padding: 0 1.5rem 1.5rem;
    color: #666;
    line-height: 1.6;
}

/* Search Results */
.search-results-header {
    background: #fff;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-results-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-link {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.search-results-nav h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.search-form-compact {
    max-width: 600px;
}

.results-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.map-section {
    order: -1;
}

.results-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.results-count {
    color: #666;
    font-weight: 400;
}

.results-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.filter-btn:hover {
    background: #f8f9fa;
}

.filter-btn.active:hover {
    background: #1557b0;
}

.toilets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toilet-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toilet-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

.toilet-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.toilet-distance {
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
}

.toilet-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feature-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.info-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: #333;
}

.info-value {
    color: #666;
}

.toilet-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #666;
    margin-bottom: 2rem;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background: #1557b0;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3,
.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    transition: opacity 0.3s ease;
}

.social-link:hover {
    opacity: 0.7;
}

.language-list,
.city-list {
    list-style: none;
}

.language-list li,
.city-list li {
    margin-bottom: 0.5rem;
}

.language-list a,
.city-list a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.language-list a:hover,
.city-list a:hover {
    color: #1a73e8;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 1rem;
    text-align: center;
    color: #ccc;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        padding: 1rem 0;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 3rem 0 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .city-card {
        padding: 1rem;
    }

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

    .search-input-group {
        flex-direction: column;
    }

    .search-button {
        justify-content: center;
    }

    .toilet-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .results-filters {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }

    .main-nav {
        display: block;
    }

    .results-layout {
        grid-template-columns: 1fr 350px;
    }

    .map-section {
        order: 1;
    }
}

@media (min-width: 1024px) {
    .results-layout {
        grid-template-columns: 1fr 400px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .feature-card,
    .city-card,
    .keyword-link,
    .toilet-card {
        border: 2px solid #000;
    }

    .search-button,
    .location-button {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .search-form,
    .features-section,
    .popular-cities-section,
    .longtail-keywords-section {
        display: none;
    }

    .faq-section {
        page-break-before: always;
    }

    .toilet-card {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Focus Styles for Accessibility */
.search-button:focus,
.location-button:focus,
.filter-btn:focus,
.action-btn:focus,
.faq-question:focus,
.keyword-link:focus,
.city-card:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #1a73e8;
    animation: spin 1s linear infinite;
}

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

/* Performance Optimizations */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder */
.lazy {
    background: #f0f0f0;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Critical CSS - Above the fold content */
.hero-section,
.header {
    font-display: swap;
}
