:root {
    --primary-color: #f97316;
    --secondary-color: #ea580c;
    --background-color: #f3f4f6;
    --text-color: #1f2937;
    --card-bg: #ffffff;
    --font-main: 'Segoe UI', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 20px;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

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

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1469474968028-56623f02e42e?q=80&w=1474&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 5rem 1rem;
    text-align: center;
    border-radius: 0 0 20px 20px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Grid Layouts
   Mantido apenas para telas antigas que optarem por usar a classe legada.
   A classe global .grid conflita com o Tailwind e quebra grades responsivas. */
.legacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card-text {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
}

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

/* Detail Page */
.detail-header {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
}

.detail-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.detail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem;
    border-radius: 0 0 12px 12px;
    color: white;
}

.section-title {
    font-size: 1.8rem;
    margin: 3rem 0 1.5rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* Admin Styles */
/* Admin Styles */
.admin-nav {
    background-color: #1f2937;
    padding: 1rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.admin-nav a,
.admin-nav span {
    color: white !important;
    text-decoration: none;
}

.admin-nav a:hover {
    opacity: 0.8;
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - 68px);
    background-color: #f9fafb;
}

.admin-sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.02);
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-sidebar nav a:hover {
    background-color: #f3f4f6;
    color: #111827;
    transform: translateX(4px);
}

.admin-sidebar nav a.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.admin-content {
    flex-grow: 1;
    min-width: 0;
    padding: 2.5rem;
    position: relative;
    overflow-x: auto;
    /* Permite scroll se a tabela for muito larga */
}

/* Close Button (X) for sections */
.btn-close-section {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
    font-size: 1.25rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-close-section:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
    transform: rotate(90deg);
}

/* Adjustments for Title Area */
.admin-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-right: 3rem;
    /* Space for the X button */
}

/* Rating & Reviews */
.rating-stars {
    display: inline-flex;
    gap: 0.25rem;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #d1d5db;
    transition: color 0.2s;
}

/* Destaca a estrela sob o mouse e todas as anteriores */
.rating-stars label:hover,
.rating-stars label:has(~ label:hover) {
    color: #fbbf24;
}

/* Destaca a estrela selecionada e todas as anteriores */
.rating-stars input:checked+label,
.rating-stars label:has(~ input:checked) {
    color: #fbbf24;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    background: #fffbeb;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid #fef3c7;
}

.reviews-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.review-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.review-user {
    font-weight: 600;
    color: #111827;
}

.review-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.review-stars {
    color: #fbbf24;
    font-size: 0.875rem;
}

.review-comment {
    color: #4b5563;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Rotta IA */
.rotta-ia-button {
    position: fixed !important;
    right: 24px;
    bottom: 24px;
    z-index: 2147483647 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    font-family: 'Outfit', var(--font-main);
    box-shadow: 0 18px 35px rgba(249, 115, 22, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rotta-ia-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(249, 115, 22, 0.45);
    background: linear-gradient(135deg, #fb923c, #f97316);
}

.rotta-ia-button:focus-visible {
    outline: 4px solid rgba(249, 115, 22, 0.28);
    outline-offset: 4px;
}

.rotta-ia-button__spark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
    line-height: 1;
}

.rotta-ia-button__spark svg {
    width: 34px !important;
    height: 34px !important;
    display: block;
    fill: #ffffff !important;
}

.rotta-ia-panel {
    position: absolute;
    right: 24px;
    bottom: 104px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: 560px;
    overflow: hidden;
    pointer-events: auto;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.dark .rotta-ia-panel {
    border-color: rgba(51, 65, 85, 0.9);
    background: #111827;
    color: #ffffff;
}

.rotta-ia-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.rotta-ia-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
}

.rotta-ia-panel__header strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
}

.rotta-ia-panel__header span {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    opacity: 0.82;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rotta-ia-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.rotta-ia-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.dark .rotta-ia-panel__body {
    background: #0f172a;
}

.rotta-ia-message {
    max-width: 92%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.45;
}

.rotta-ia-message--bot {
    border-bottom-left-radius: 6px;
    background: #ffffff;
    color: #334155;
}

.dark .rotta-ia-message--bot {
    background: #1e293b;
    color: #dbeafe;
}

.rotta-ia-message--user {
    margin-left: auto;
    border-bottom-right-radius: 6px;
    background: #f97316;
    color: #ffffff;
}

.rotta-ia-suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.rotta-ia-suggestions button {
    min-height: 40px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.dark .rotta-ia-suggestions button {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.12);
    color: #fed7aa;
}

.rotta-ia-panel__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.dark .rotta-ia-panel__form {
    border-top-color: #334155;
    background: #111827;
}

.rotta-ia-panel__form input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 14px;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
}

.dark .rotta-ia-panel__form input {
    border-color: #334155;
    background: #0f172a;
    color: #ffffff;
}

.rotta-ia-panel__form button {
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: #f97316;
    color: #ffffff;
    padding: 0 16px;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

.rotta-ia-panel__form button:disabled,
.rotta-ia-panel__form input:disabled {
    opacity: 0.7;
    cursor: wait;
}

.rotta-ia-results {
    display: grid;
    gap: 8px;
    margin: 4px 0 14px;
}

.rotta-ia-result-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.dark .rotta-ia-result-card {
    border-color: #334155;
    background: #1e293b;
}

.rotta-ia-result-card strong {
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.25;
}

.dark .rotta-ia-result-card strong {
    color: #ffffff;
}

.rotta-ia-result-card__category {
    color: #f97316;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.rotta-ia-result-card__address {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 750;
}

.dark .rotta-ia-result-card__address {
    color: #cbd5e1;
}

.rotta-ia-result-card__description {
    display: -webkit-box;
    overflow: hidden;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dark .rotta-ia-result-card__description {
    color: #cbd5e1;
}

.rotta-ia-result-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.rotta-ia-result-card__actions a,
.rotta-ia-result-card__actions button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #fff7ed;
    color: #ea580c;
    padding: 0 12px;
    font-size: 0.72rem;
    font-weight: 900;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.dark .rotta-ia-result-card__actions a,
.dark .rotta-ia-result-card__actions button {
    background: rgba(249, 115, 22, 0.14);
    color: #fed7aa;
}

/* Portal do usuario: perfil em tema escuro */
.dark .perfil-page .bg-white {
    background-color: #1e293b !important;
}

.dark .perfil-page .bg-slate-50 {
    background-color: rgba(15, 23, 42, 0.62) !important;
}

.dark .perfil-page .bg-slate-100 {
    background-color: #334155 !important;
}

.dark .perfil-page .border-slate-50,
.dark .perfil-page .border-slate-100,
.dark .perfil-page .border-slate-200 {
    border-color: #334155 !important;
}

.dark .perfil-page .shadow-slate-200\/50,
.dark .perfil-page .shadow-xl,
.dark .perfil-page .shadow-2xl {
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.24) !important;
}

.dark .perfil-page .text-slate-900,
.dark .perfil-page .text-slate-800,
.dark .perfil-page .text-slate-700,
.dark .perfil-page .text-slate-600 {
    color: #f8fafc !important;
}

.dark .perfil-page .text-slate-500,
.dark .perfil-page .text-slate-400 {
    color: #94a3b8 !important;
}

.dark .perfil-page .text-slate-300 {
    color: #64748b !important;
}

.dark .perfil-page .hover\:bg-white:hover {
    background-color: #273449 !important;
}

.dark .perfil-page .group\/item:hover {
    background-color: rgba(51, 65, 85, 0.62) !important;
}

.dark .perfil-page .bg-primary\/5 {
    background-color: rgba(249, 115, 22, 0.13) !important;
}

.dark .perfil-page .border-primary\/10 {
    border-color: rgba(249, 115, 22, 0.24) !important;
}

.dark .perfil-page input,
.dark .perfil-page select,
.dark .perfil-page textarea {
    background-color: rgba(15, 23, 42, 0.72) !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

.dark .perfil-page input::placeholder,
.dark .perfil-page textarea::placeholder {
    color: #64748b !important;
}

.dark .perfil-page .bg-amber-50 {
    background-color: rgba(251, 191, 36, 0.12) !important;
}

.dark .perfil-page .border-amber-100 {
    border-color: rgba(251, 191, 36, 0.22) !important;
}

.dark .perfil-page .text-amber-700 {
    color: #fde68a !important;
}

@media (max-width: 640px) {
    .rotta-ia-button {
        right: 18px !important;
        bottom: calc(72px + env(safe-area-inset-bottom)) !important;
        width: 58px !important;
        height: 58px !important;
        justify-content: center !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .rotta-ia-button__spark {
        width: 100%;
        height: 100%;
    }

    .rotta-ia-button__spark svg {
        width: 31px !important;
        height: 31px !important;
    }

    .rotta-ia-panel {
        border-radius: 22px;
    }

    .rotta-ia-suggestions {
        grid-template-columns: 1fr;
    }
}
