:root {
    --primary: #FF7E67;
    --primary-light: #FF9B8A;
    --secondary: #4FB3AA;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --accent: #FFD93D;
    --safe-area-inset-top: env(safe-area-inset-top);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header & Landing */
header {
    padding: calc(2rem + var(--safe-area-inset-top)) 1.25rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 0 0 2rem 2rem;
    box-shadow: var(--shadow);
    text-align: left;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.trust-line {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.location-selector {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 0.5rem;
}

/* Filters */
.filter-section {
    padding: 1.5rem 1.5rem 1rem;
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 10;
}

.helper-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
    margin-top: 1rem;
}

.results-label {
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.filter-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    gap: 0.5rem;
}

.filter-chip.active {
    background: white;
    border-color: var(--secondary);
    color: var(--secondary);
    transform: scale(0.95);
    box-shadow: none;
}

.filter-icon {
    font-size: 1.5rem;
}

/* Results */
.results-container {
    padding: 0 1.5rem 5rem;
}

.restaurant-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease-out forwards;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.restaurant-card:active {
    transform: scale(0.98);
}

.restaurant-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.restaurant-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.decision-summary {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.restaurant-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.75rem;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: rgba(79, 179, 170, 0.05);
    color: var(--secondary);
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.8;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

/* Detail View */
.view {
    display: none;
    min-height: 100vh;
}

.view.active {
    display: block;
}

.detail-header {
    padding: calc(1rem + var(--safe-area-inset-top)) 1.25rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1.25rem;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: none;
}

.detail-content {
    padding: 1.5rem;
}

.ai-summary {
    background: #FFF9F0;
    border-radius: 1.25rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid #FFE8CC;
}

.ai-summary-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #D97706;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-summary-text {
    font-size: 0.9rem;
    color: #92400E;
    line-height: 1.6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Floating Share Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.75rem;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: none;
    font-size: 1.25rem;
    z-index: 100;
    transition: var(--transition);
}

.fab:active {
    transform: scale(0.9);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Modal Bottom Sheet */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Add padding for mobile safe area */
    padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
    background: var(--bg-color);
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
}

.loc-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.loc-btn.active {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.loc-chips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.loc-chip {
    padding: 0.75rem 0.5rem;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
}

.loc-chip.active {
    background: white;
    border-color: var(--secondary);
    color: var(--secondary);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.transparency-note-home {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.transparency-note-detail {
    display: none; /* Removed from absolute bottom */
}

/* AI Summary Disclaimer UX */
.ai-summary-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-icon {
    font-size: 0.9rem;
    color: #D97706;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.info-icon:hover {
    opacity: 1;
}

.disclaimer-expandable {
    display: none;
    font-size: 0.75rem;
    color: #92400E;
    background: rgba(217, 119, 6, 0.05);
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    border: 1px dashed rgba(217, 119, 6, 0.2);
    animation: fadeIn 0.3s ease-out;
}

.disclaimer-expandable.active {
    display: block;
}

.summary-helper {
    font-size: 0.7rem;
    color: #D97706;
    opacity: 0.6;
    margin-top: 0.5rem;
    font-weight: 500;
}
