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

:root {
    --primary-color: #2D5F3F;
    --secondary-color: #7FB069;
    --accent-color: #E63946;
    --background: #FEFEFE;
    --card-background: #FFFFFF;
    --text-primary: #2B2D42;
    --text-secondary: #6C757D;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

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

/* Header */
header {
    background-image: linear-gradient(rgba(45, 95, 63, 0.4), rgba(45, 95, 63, 0.4)), url('images/Ashland.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
}

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.8;
}

/* Main Content */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 300px);
}

/* Search Section */
.search-section {
    margin-bottom: 1.5rem;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background-color: var(--card-background);
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
}

.filter-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
}

.clear-button {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-button:hover {
    background-color: #D62839;
}

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

.filter-group {
    background-color: var(--background);
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.filter-group-hover:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

.filter-group-wide {
    grid-column: 1 / -1;
}

.filter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-options {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
    margin-top: 0;
    padding-top: 0;
    border-top: 0px solid var(--border-color);
}

.filter-group-hover:hover .filter-options {
    max-height: 2000px;
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--secondary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Radio Options */
.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.radio-option:hover {
    background-color: var(--background);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Cuisine Grid */
.cuisine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.cuisine-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.cuisine-option:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.cuisine-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cuisine-option.selected {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Restaurant Grid */
.restaurant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.restaurant-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    max-height: 520px;
    position: relative;
}

.restaurant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    max-height: 700px;
}

.restaurant-card.open-now {
    border-left: 4px solid #22c55e;
}

.open-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #22c55e;
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    letter-spacing: 0.5px;
}

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

.restaurant-content {
    padding: 1.5rem;
}

.restaurant-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.restaurant-cuisine {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.restaurant-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em;
    transition: all 0.3s ease;
}

.restaurant-card:hover .restaurant-description {
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
}

.restaurant-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.restaurant-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range {
    color: var(--accent-color);
    font-weight: 600;
}

/* Restaurant Links */
.restaurant-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s;
    flex: 0 0 auto;
    text-align: center;
    border: 2px solid #E8B86D;
    background-color: #FEF7E8;
    color: #8B5A2B;
    white-space: nowrap;
}

.link-button svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.website-link:hover {
    background-color: #F5E6CC;
    border-color: #D4A574;
    color: #6B4423;
}

.facebook-link:hover {
    background-color: #F5E6CC;
    border-color: #D4A574;
    color: #6B4423;
}

.instagram-link:hover {
    background-color: #F5E6CC;
    border-color: #D4A574;
    color: #6B4423;
}

/* Restaurant Detail Page */
.detail-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.detail-cuisine {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    width: fit-content;
}

.detail-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.info-section {
    padding: 1.5rem;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
}

.info-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.info-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.detail-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hours Table */
.hours-list {
    list-style: none;
}

.hours-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.hours-list li:last-child {
    border-bottom: none;
}

.day {
    font-weight: 600;
    text-transform: capitalize;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.social-link:hover {
    background-color: var(--secondary-color);
}

/* Reviews */
.review-card {
    padding: 1.5rem;
    background-color: var(--background);
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 1rem;
}

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

.review-author {
    font-weight: 600;
    color: var(--text-primary);
}

.review-rating {
    color: #FFB800;
    font-weight: 600;
}

.review-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.review-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Website Button */
.website-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    text-align: center;
    transition: background-color 0.2s;
}

.website-button:hover {
    background-color: #D62839;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Footer */
footer {
    background-image: linear-gradient(rgba(45, 95, 63, 0.4), rgba(45, 95, 63, 0.4)), url('images/Ashland.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

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

    .detail-header {
        grid-template-columns: 1fr;
    }

    .detail-sections {
        grid-template-columns: 1fr;
    }

    .detail-name {
        font-size: 2rem;
    }

    .detail-image {
        height: 300px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 1rem;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

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

.pagination-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-number {
    padding: 0.5rem 0.75rem;
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.page-number:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-number.disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.page-number.disabled:hover {
    background-color: #f5f5f5;
    color: #ccc;
    border-color: var(--border-color);
}

/* Mobile pagination */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 0.5rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .page-number {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .pagination-numbers {
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .pagination-info {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pagination-numbers {
        order: -1;
    }
}

