/* Sistema de Acompanhantes - CSS Principal */

/* ========================================
   TEMA CLARO FORÇADO
   ======================================== */

/* Variáveis CSS para tema claro consistente */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* Forçar tema claro em todos os dispositivos */
* {
    color-scheme: light !important;
}

/* Override para preferências de dark mode do sistema */
@media (prefers-color-scheme: dark) {
    * {
        color-scheme: light !important;
    }
    
    body {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Garantir que elementos comuns mantenham tema claro */
    .bg-white {
        background-color: var(--bg-primary) !important;
    }
    
    .bg-gray-100 {
        background-color: var(--bg-secondary) !important;
    }
    
    .bg-gray-50 {
        background-color: var(--bg-tertiary) !important;
    }
    
    .text-gray-900 {
        color: var(--text-primary) !important;
    }
    
    .text-gray-700 {
        color: var(--text-secondary) !important;
    }
    
    .text-gray-500 {
        color: var(--text-muted) !important;
    }
    
    .border-gray-200 {
        border-color: var(--border-color) !important;
    }
    
    /* Formulários sempre com fundo claro */
    input, textarea, select {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Cards e containers */
    .card, .modal-content, .dropdown-menu {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Navegação */
    .navbar, .sidebar, nav {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Tabelas */
    table, th, td {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Botões mantêm suas cores específicas mas com fundo claro quando neutros */
    .btn-secondary, .btn-outline {
        background-color: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
}

/* Reset e Base */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animações */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Cards de anúncio */
.ad-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-verified {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-featured {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-available {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background-color: #dc3545;
    color: white;
}

.btn-primary:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #28a745;
    color: white;
}

.btn-secondary:hover {
    background-color: #218838;
}

.btn-outline {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: transparent;
}

.btn-outline:hover {
    background-color: #dc3545;
    color: white;
}

/* Forms */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
}

.form-checkbox:checked {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Galeria de fotos */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Sticky contact bar */
.contact-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 50;
    display: flex;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .contact-bar {
        display: none;
    }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc3545;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 200;
    transform: translateX(120%);
    transition: transform 0.3s;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-info {
    background-color: #17a2b8;
}

/* Responsivo */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Aspect ratios */
.aspect-square {
    aspect-ratio: 1/1;
}

.aspect-video {
    aspect-ratio: 16/9;
}

.aspect-portrait {
    aspect-ratio: 3/4;
}

/* Estilos específicos para validação */
.validation-error {
    display: block;
    font-size: 0.875rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

.validation-errors-container {
    animation: fadeIn 0.3s ease-in;
}

/* Campos com erro */
input.border-red-500,
textarea.border-red-500,
select.border-red-500 {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input.border-red-500:focus,
textarea.border-red-500:focus,
select.border-red-500:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ============================================
   GEOLOCALIZAÇÃO
   ============================================ */

/* Campo de localização detectada automaticamente */
#search-location.location-detected {
    background-color: #f0f9ff;
    border-color: #0ea5e9;
    color: #0c4a6e;
}

#search-location.location-detected::placeholder {
    color: #0c4a6e;
}

/* Botão de localização */
[data-location-btn] {
    transition: all 0.2s ease;
}

[data-location-btn]:hover {
    color: #dc3545 !important;
    transform: scale(1.1);
}

[data-location-btn]:active {
    transform: scale(0.95);
}

/* Animação de pulso para indicar que está detectando */
.location-detecting {
    animation: locationPulse 2s infinite;
}

@keyframes locationPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Indicador de localização ativa */
.location-indicator {
    position: relative;
}

.location-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
    animation: locationBlink 2s infinite;
}

@keyframes locationBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Tooltip para botão de localização */
[data-location-btn][title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 0.25rem;
}

[data-location-btn][title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 10;
}

/* Estados do campo de localização */
#search-location:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Animação de loading no botão */
.location-loading {
    animation: spin 1s linear infinite;
}

/* Feedback visual para localização bem-sucedida */
.location-success {
    animation: locationSuccess 0.6s ease-out;
}

@keyframes locationSuccess {
    0% {
        background-color: #f0f9ff;
        transform: scale(1);
    }
    50% {
        background-color: #dcfce7;
        transform: scale(1.02);
    }
    100% {
        background-color: #f0f9ff;
        transform: scale(1);
    }
}

/* Responsivo para geolocalização */
@media (max-width: 640px) {
    [data-location-btn] {
        padding: 0.5rem;
    }
    
    [data-location-btn] svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* ============================================
   FORÇA TEMA CLARO
   ============================================ */

/* Variáveis CSS para tema claro consistente */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
}

/* Força color-scheme light em todos os elementos */
*, *::before, *::after {
    color-scheme: light !important;
}

/* Override para preferências de dark mode do sistema */
@media (prefers-color-scheme: dark) {
    /* Força backgrounds brancos e textos escuros */
    html, body {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Força tema claro em todos os elementos de formulário */
    input, textarea, select, button {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Força tema claro em cards e containers */
    .bg-white, [class*="bg-white"] {
        background-color: var(--bg-primary) !important;
    }
    
    .bg-gray-50, [class*="bg-gray-50"] {
        background-color: var(--bg-secondary) !important;
    }
    
    .bg-gray-100, [class*="bg-gray-100"] {
        background-color: var(--bg-tertiary) !important;
    }
    
    /* Força texto escuro */
    .text-gray-900, [class*="text-gray-900"] {
        color: var(--text-primary) !important;
    }
    
    .text-gray-700, [class*="text-gray-700"] {
        color: var(--text-secondary) !important;
    }
    
    .text-gray-500, [class*="text-gray-500"] {
        color: var(--text-muted) !important;
    }
    
    /* Força bordas claras */
    .border-gray-200, [class*="border-gray-200"] {
        border-color: var(--border-color) !important;
    }
    
    .border-gray-300, [class*="border-gray-300"] {
        border-color: var(--border-color) !important;
    }
    
    /* Força sombras claras */
    .shadow, .shadow-sm, .shadow-md, .shadow-lg {
        box-shadow: 0 1px 3px 0 var(--shadow-light), 0 1px 2px 0 var(--shadow-medium) !important;
    }
    
    /* Força tema claro em tabelas */
    table, th, td {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Força tema claro em navegação */
    nav, header, footer {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Força tema claro em modais e overlays */
    .modal, .modal-content, .dropdown, .tooltip {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
}

/* Garantir tema claro em elementos específicos do sistema */
.form-input, .form-select, .form-textarea {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Garantir que dropdowns e selects mantenham tema claro */
select option {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Garantir tema claro em elementos de admin e painel */
.admin-panel, .user-panel, .sidebar {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Garantir tema claro em cards de anúncios */
.ad-card, .card, .panel {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Garantir tema claro em elementos de navegação mobile */
@media (max-width: 768px) {
    .mobile-menu, .mobile-nav, .mobile-sidebar {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
}

/* ============================================
   CORREÇÃO SIDEBAR PAINEL - ANTI F5 BUG
   ============================================ */

/* Força o sidebar do painel a manter cor escura sempre */
.sidebar-panel {
    background-color: #1f2937 !important;
    color: white !important;
}

.sidebar-panel * {
    color: white !important;
}

.sidebar-panel a {
    color: white !important;
}

.sidebar-panel .text-primary {
    color: #dc3545 !important;
}

.sidebar-panel .text-white {
    color: white !important;
}

.sidebar-panel .text-red-400 {
    color: #f87171 !important;
}

.sidebar-panel .border-gray-700 {
    border-color: #374151 !important;
}

.sidebar-panel .hover\:bg-gray-700:hover {
    background-color: #374151 !important;
}

.sidebar-panel .bg-gray-700 {
    background-color: #374151 !important;
}

.sidebar-panel .bg-primary {
    background-color: #dc3545 !important;
}

/* Força o sidebar mesmo com dark mode override */
@media (prefers-color-scheme: dark) {
    .sidebar-panel {
        background-color: #1f2937 !important;
        color: white !important;
    }
    
    .sidebar-panel * {
        color: white !important;
    }
    
    .sidebar-panel a {
        color: white !important;
    }
    
    .sidebar-panel .text-primary {
        color: #dc3545 !important;
    }
}

/* Força após carregamento da página */
body.loaded .sidebar-panel {
    background-color: #1f2937 !important;
    color: white !important;
}

/* Força com especificidade máxima */
#panel-sidebar.sidebar-panel {
    background-color: #1f2937 !important;
    color: white !important;
}

#panel-sidebar.sidebar-panel * {
    color: white !important;
}

#panel-sidebar.sidebar-panel a {
    color: white !important;
}

#panel-sidebar.sidebar-panel .text-primary {
    color: #dc3545 !important;
}

#panel-sidebar.sidebar-panel .text-white {
    color: white !important;
}

/* Correção para SVG icons */
#panel-sidebar.sidebar-panel svg {
    color: white !important;
    fill: currentColor !important;
}

/* Correção para botões hover */
#panel-sidebar.sidebar-panel button:hover,
#panel-sidebar.sidebar-panel a:hover {
    background-color: #374151 !important;
    color: white !important;
}

/* Correção específica para o botão de sair */
#panel-sidebar.sidebar-panel .text-red-400 {
    color: #f87171 !important;
}

#panel-sidebar.sidebar-panel .text-red-400:hover {
    color: #fca5a5 !important;
}