/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --morandi-sage: #B8C8D8;      /* Soft baby blue for primary actions */
    --morandi-clay: #E8D4E0;      /* Gentle pink for highlights */
    --morandi-dust: #F0E8F0;      /* Very light pink for backgrounds */
    --morandi-stone: #A8B8C8;     /* Muted blue-gray for secondary text */
    --morandi-mist: #D8C8D8;      /* Soft lavender-pink for subtle elements */
    --morandi-cream: #F8F4F8;     /* Almost white with hint of pink */
    --morandi-deep: #708090;      /* Deeper blue-gray for text */
    --morandi-accent: #C8A8C8;    /* Muted pink accent */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--morandi-deep);
    background: linear-gradient(135deg, var(--morandi-sage) 0%, var(--morandi-clay) 50%, var(--morandi-dust) 100%);
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.nav-brand h1 {
    color: var(--morandi-deep);
    font-size: 1.5rem;
    font-weight: 600;
}

.portfolio-link {
    color: var(--morandi-accent);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.portfolio-link:hover {
    background: var(--morandi-accent);
    color: var(--morandi-cream);
}

/* Main content */
.main {
    margin-top: 80px;
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-bottom: 3rem;
}

.hero-content h2 {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search container */
.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-options {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-radius {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.radius-select {
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--morandi-deep);
    font-size: 0.9rem;
    cursor: pointer;
}

.search-box {
    display: flex;
    width: 100%;
    gap: 0.5rem;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.location-input {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.location-input:focus {
    outline: none;
    box-shadow: 0 4px 25px rgba(184, 200, 216, 0.4);
    background: rgba(255, 255, 255, 0.95);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
    border: 1px solid var(--morandi-mist);
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--morandi-dust);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--morandi-dust);
    color: var(--morandi-deep);
}

.autocomplete-item.highlighted {
    background: var(--morandi-sage);
    color: white;
}

.autocomplete-city {
    font-weight: 600;
    color: var(--morandi-deep);
}

.autocomplete-country {
    font-size: 0.9rem;
    color: var(--morandi-stone);
}

.autocomplete-count {
    margin-left: auto;
    background: var(--morandi-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.search-btn, .location-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.search-btn {
    background: var(--morandi-accent);
    color: var(--morandi-cream);
    box-shadow: 0 4px 20px rgba(139, 154, 122, 0.3);
}

.search-btn:hover {
    background: var(--morandi-deep);
    transform: translateY(-2px);
}

.location-btn {
    background: rgba(244, 241, 237, 0.9);
    color: var(--morandi-accent);
    border: 2px solid transparent;
}

.location-btn:hover {
    border-color: var(--morandi-cream);
    background: var(--morandi-cream);
}

/* Results section */
.results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

.results-header h3 {
    color: var(--morandi-deep);
    font-size: 1.8rem;
    font-weight: 600;
}

.view-toggle {
    display: flex;
    background: var(--morandi-mist);
    border-radius: 10px;
    padding: 0.25rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.view-btn.active {
    background: var(--morandi-accent);
    color: var(--morandi-cream);
}

/* Studio list */
.studio-list {
    display: grid;
    gap: 1.5rem;
}

.studio-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.studio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--morandi-accent);
}

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

.studio-info h4 {
    color: var(--morandi-deep);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.studio-address {
    color: var(--morandi-stone);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.studio-distance {
    color: var(--morandi-accent);
    font-weight: 500;
    font-size: 0.9rem;
}

.studio-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #ffd700;
    font-size: 1.1rem;
}

.rating-text {
    color: var(--morandi-stone);
    font-size: 0.9rem;
}

.studio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: var(--morandi-cream);
    color: var(--morandi-accent);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Map container */
.map-container {
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Featured studios */
.featured-studios {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.featured-studios h3 {
    color: var(--morandi-deep);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

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

.featured-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.featured-image {
    height: 200px;
    background: linear-gradient(45deg, var(--morandi-sage), var(--morandi-clay));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--morandi-cream);
    font-size: 3rem;
}

.featured-content {
    padding: 1.5rem;
}

.featured-content h4 {
    color: var(--morandi-deep);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.featured-content p {
    color: var(--morandi-stone);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--morandi-deep);
}

/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--morandi-cream);
    border-top: 4px solid var(--morandi-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-spinner p {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--morandi-stone);
}

.footer-content a {
    color: var(--morandi-accent);
    text-decoration: none;
    font-weight: 500;
}

.footer-content a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .main {
        padding: 1rem;
    }

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

    .search-box {
        flex-direction: column;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .results {
        padding: 1rem;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
}

/* Pagination Styles */
.pagination {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--morandi-cream);
}

.pagination-info {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--morandi-stone);
    font-size: 0.9rem;
}

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

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--morandi-clay);
    background: white;
    color: var(--morandi-deep);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--morandi-sage);
    color: white;
    border-color: var(--morandi-sage);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--morandi-cream);
    color: var(--morandi-stone);
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

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

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

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

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-numbers {
        order: -1;
    }
}