/* 
 * Regional Thali Guide Styles
 * Adheres to global theming and responsive design principles.
 */

:root {
    --primary-color: #e65100;
    --primary-hover: #ff9800;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --focus-ring: #ff9800;
    --transition-speed: 0.3s;
}

body.dark-theme {
    --primary-color: #ff9800;
    --primary-hover: #ffb74d;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --border-color: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Header */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

.theme-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Region Selector */
.region-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.region-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.region-btn:hover {
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.region-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.region-btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Thali Layout (2-Column) */
.thali-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* SVG Container */
.svg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.thali-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.15));
}

/* Interactive SVG Elements */
.dish {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    transform-origin: center;
}

.dish:hover,
.dish:focus-visible,
.dish.active-dish {
    transform: scale(1.1);
    filter: brightness(1.1) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3));
    outline: none;
}

.dish:focus-visible {
    /* Focus handled by SVG filter, but fallback for a11y */
}

/* Info Panel */
.info-panel {
    position: sticky;
    top: 2rem;
}

.info-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.dish-details {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.dish-details.hidden {
    display: none;
}

.empty-state.hidden {
    display: none;
}

.dish-name {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dish-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.ingredients-section {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
}

.ingredients-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.ingredients-list {
    list-style-position: inside;
    color: var(--text-muted);
}

.ingredients-list li {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .thali-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .info-panel {
        position: static;
    }

    .info-card {
        min-height: auto;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2rem;
    }

    .region-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .thali-container {
        padding: 1rem;
    }
}


/* ================================================================
   INTERACTIVE MAP (added for state-based thali selection)
   ================================================================ */
.map-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}

.map-container {
    position: relative;
    width: 100%;
    background-color: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.map-background {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10%;
    opacity: 0.9;
}

.markers-layer {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    pointer-events: none;
}

.food-marker {
    position: absolute;
    width: 34px;
    height: 34px;
    background-color: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    z-index: 10;
}

.food-marker:hover,
.food-marker.active-marker {
    transform: translate(-50%, -50%) scale(1.4);
    z-index: 20;
    box-shadow: 0 6px 12px rgba(230, 81, 0, 0.4);
    background-color: var(--primary-color);
}

.food-marker.active-marker {
    border-color: #fff;
}

.food-marker:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.marker-tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    pointer-events: none;
}

.food-marker:hover .marker-tooltip,
.food-marker:focus-visible .marker-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Region info panel */
.region-panel {
    position: sticky;
    top: 2rem;
}

.region-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    min-height: 400px;
}

.region-title {
    font-size: 1.7rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.region-state {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

.region-description {
    margin-bottom: 1.5rem;
}

.region-facts {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.fact-block {
    background-color: var(--bg-color);
    padding: 1rem 1.25rem;
    border-radius: 12px;
}

.fact-block h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.fact-block p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.region-details.hidden {
    display: none;
}

/* Thali layout toggling */
.thali-layout.hidden {
    display: none;
}

/* Credits section */
.credits-section {
    max-width: 800px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.credits-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-container {
        aspect-ratio: 4 / 3;
    }

    .region-panel {
        position: static;
    }

    .region-card {
        min-height: auto;
    }
}