/*
Theme Name: Restaurant Finder
Description: A custom WordPress theme that replicates MontessoriFind.com design for restaurant directory
Version: 1.0
Author: Custom Theme
*/

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Header Styles */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.site-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
}

.site-logo .logo-icon {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    fill: #059669;
}

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

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

.main-navigation a:hover {
    color: #059669;
}

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

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero-stats {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.hero-cta {
    display: inline-block;
    background-color: white;
    color: #059669;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Browse by Location Section */
.browse-location-section {
    padding: 4rem 0;
    background-color: #f9fafb;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 3rem;
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.state-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.state-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #059669;
}

.state-abbreviation {
    font-size: 2rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.5rem;
}

.state-name {
    font-size: 1.1rem;
    color: #374151;
    font-weight: 500;
}

/* Restaurant Listings */
.restaurant-listings {
    padding: 4rem 0;
}

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

.listings-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.listings-count {
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    text-decoration: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #374151;
}

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

.restaurant-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.restaurant-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.restaurant-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.restaurant-content {
    padding: 1.5rem;
}

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

.restaurant-name {
    color: #059669;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.restaurant-cuisine {
    color: #6b7280;
    font-size: 0.9rem;
}

.featured-badge {
    background: #f97316;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.restaurant-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: #fbbf24;
}

.rating-score {
    font-weight: 600;
    color: #111827;
}

.rating-count {
    color: #6b7280;
    font-size: 0.9rem;
}

.restaurant-location,
.restaurant-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.restaurant-price {
    color: #059669;
    font-weight: 600;
    margin-bottom: 1rem;
}

.restaurant-description {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.restaurant-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: #f3f4f6;
    transform: scale(1.05);
}

/* Sidebar */
.sidebar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}

.search-form {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-btn {
    width: 100%;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #2563eb;
}

.location-finder {
    width: 100%;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
}

.location-finder:hover {
    background: #2563eb;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-item input {
    margin: 0;
}

.checkbox-item label {
    color: #374151;
    font-size: 0.9rem;
}

/* Layout */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Enhanced Responsive Design */

/* Mobile Menu */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #374151;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    z-index: 100;
}

.mobile-menu.active {
    display: block;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .section-container {
        padding: 0 1.5rem;
    }
    
    .states-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .restaurants-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .restaurant-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .restaurant-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        font-size: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .states-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .restaurants-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
        position: relative;
    }
    
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-button {
        display: block;
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
    }
    
    .mobile-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu li {
        margin-bottom: 0.5rem;
    }
    
    .mobile-menu a {
        display: block;
        padding: 0.75rem;
        color: #374151;
        text-decoration: none;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .listings-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .view-controls {
        width: 100%;
        justify-content: center;
    }
    
    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .restaurant-card {
        margin-bottom: 1rem;
    }
    
    .restaurant-actions {
        justify-content: center;
        gap: 1rem;
    }
    
    .action-btn {
        width: 50px;
        height: 50px;
    }
    
    /* Single restaurant mobile styles */
    .restaurant-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .restaurant-content {
        grid-template-columns: 1fr;
    }
    
    .restaurant-details {
        text-align: left;
    }
    
    .sidebar .quick-actions div {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .states-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .state-card {
        padding: 1.5rem;
    }
    
    .state-abbreviation {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-cta {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0 auto;
    }
    
    .section-container,
    .hero-container {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .listings-title {
        font-size: 1.5rem;
    }
    
    .restaurant-name {
        font-size: 1.1rem;
    }
    
    .restaurant-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .view-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .view-btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .sidebar {
        order: -1;
    }
    
    .filter-section {
        margin-bottom: 1.5rem;
    }
    
    .checkbox-item {
        padding: 0.5rem 0;
    }
}

/* Extra Small Devices */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        font-size: 0.9rem;
    }
    
    .state-card {
        padding: 1rem;
    }
    
    .restaurant-card {
        margin-bottom: 1rem;
    }
    
    .restaurant-content {
        padding: 1rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .states-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .restaurant-card,
    .state-card,
    .view-btn,
    .action-btn,
    .hero-cta {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .action-btn {
        width: 44px;
        height: 44px;
    }
    
    .checkbox-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .checkbox-item input {
        width: 20px;
        height: 20px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .restaurant-image,
    .hero-section {
        image-rendering: crisp-edges;
    }
}

/* Print styles for mobile */
@media print {
    .mobile-menu,
    .mobile-menu-button,
    .view-controls,
    .action-btn,
    .hero-cta {
        display: none !important;
    }
    
    .restaurant-card {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
}

/* Focus styles for accessibility */
.hero-cta:focus,
.view-btn:focus,
.action-btn:focus,
.search-btn:focus,
.location-finder:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #059669;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Smooth animations */
.restaurant-card,
.state-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1f2937;
        --text-color: #f9fafb;
        --card-bg: #374151;
        --border-color: #4b5563;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .restaurant-card,
    .state-card,
    .sidebar {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .restaurant-card,
    .state-card,
    .hero-cta,
    .view-btn,
    .action-btn {
        transition: none;
    }
    
    .loading::after {
        animation: none;
    }
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print Styles */
@media print {
    .hero-section,
    .sidebar,
    .main-navigation {
        display: none;
    }
    
    .restaurant-card {
        page-break-inside: avoid;
    }
}