/*
 * TOOLTIP_PREMIUM.CSS
 * Sistema de Tooltips Premium Uniforme (Lotes + Unidades)
 * Conforme MANIFESTOS_OFICIAIS.md V6.1 + Guarujá GeoMap V5.1
 * Glasmorphism + Tipografia Outfit/Inter
 */

:root {
    /* Cores Uniforme para Tooltips */
    --tooltip-bg: rgba(15, 23, 42, 0.95);
    --tooltip-card: rgba(30, 41, 59, 0.8);
    --tooltip-border: rgba(255, 255, 255, 0.1);
    --tooltip-text: #f8fafc;
    --tooltip-muted: #94a3b8;
    --tooltip-accent: #3b82f6;
    --tooltip-accent-alt: #10b981;
    --tooltip-danger: #ef4444;
    --tooltip-warning: #f59e0b;

    /* Glasmorphism Blur */
    --tooltip-blur: 16px;

    /* Sombras Premium */
    --tooltip-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --tooltip-shadow-md: 0 12px 24px rgba(0, 0, 0, 0.3);
    --tooltip-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

.lot-tooltip-container,
.unit-tooltip-container {
    background: var(--tooltip-bg);
    -webkit-backdrop-filter: blur(var(--tooltip-blur));
    backdrop-filter: blur(var(--tooltip-blur));
    border: 1px solid var(--tooltip-border);
    border-radius: 24px;
    box-shadow: var(--tooltip-shadow-lg);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   HEADER COM IMAGEM
   ======================================== */

.tooltip-header-img {
    position: relative;
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #1e40af, #0f172a);
    border-bottom: 1px solid var(--tooltip-border);
    overflow: hidden;
}

.tooltip-header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.tooltip-header-img img.loaded {
    opacity: 1;
}

.shimmer-loading {
    animation: shimmer 2s infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Badge Zona */
.lot-badge-zona,
.unit-badge-tipo {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(59, 130, 246, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Close Button */
.lot-tooltip-close,
.unit-tooltip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.lot-tooltip-close:hover,
.unit-tooltip-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: scale(1.1);
}

/* Header Overlay Info */
.header-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 24px;
    color: white;
}

.header-overlay-info h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -1px;
}

.header-overlay-info p {
    font-size: 14px;
    color: #cbd5e1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   CHIPS DE CONTEXTO (Context Pills)
   ======================================== */

.lot-context-chips,
.unit-context-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--tooltip-border);
    overflow-x: auto;
    scrollbar-width: thin;
}

.ctx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--tooltip-accent);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
    white-space: nowrap;
    transition: all 0.3s;
}

.ctx-chip:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.ctx-chip.accent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tooltip-accent-alt);
    border-color: rgba(16, 185, 129, 0.2);
}

.ctx-chip.accent:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
}

.ctx-chip.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tooltip-warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.ctx-chip.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--tooltip-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.ctx-chip i {
    font-size: 12px;
}

/* ========================================
   DESCRIÇÃO BAR
   ======================================== */

.lot-descricao-bar,
.unit-descricao-bar {
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--tooltip-accent);
    color: var(--tooltip-muted);
    font-size: 13px;
    border-bottom: 1px solid var(--tooltip-border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.lot-descricao-bar i,
.unit-descricao-bar i {
    color: var(--tooltip-accent);
    margin-top: 2px;
}

/* ========================================
   BODY + TABS
   ======================================== */

.lot-tooltip-body,
.unit-tooltip-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tooltip-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--tooltip-border);
    background: rgba(15, 23, 42, 0.3);
}

.lot-tab-btn,
.unit-tab-btn {
    background: none;
    border: none;
    color: var(--tooltip-muted);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.lot-tab-btn:hover,
.unit-tab-btn:hover {
    color: var(--tooltip-text);
    opacity: 0.9;
}

.lot-tab-btn.active,
.unit-tab-btn.active {
    color: var(--tooltip-accent);
    border-bottom-color: var(--tooltip-accent);
    opacity: 1;
}

.lot-tab-content,
.unit-tab-content {
    display: none;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 400px);
}

.lot-tab-content.active,
.unit-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.scrollable-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* ========================================
   GRID DE ATRIBUTOS MINI CARDS
   ======================================== */

.attribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.attribute-card {
    background: var(--tooltip-card);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--tooltip-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.attribute-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--tooltip-accent);
    transform: translateY(-2px);
}

.attribute-card-icon {
    font-size: 20px;
    color: var(--tooltip-accent);
    margin-bottom: 8px;
}

.attribute-card-label {
    font-size: 11px;
    color: var(--tooltip-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.attribute-card-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--tooltip-text);
    font-family: 'Outfit', sans-serif;
    word-break: break-word;
}

.attribute-card-unit {
    font-size: 11px;
    color: var(--tooltip-muted);
    margin-top: 2px;
}

/* ========================================
   SEÇÕES INFORMATIVAS
   ======================================== */

.tooltip-section {
    margin-bottom: 24px;
}

.tooltip-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: var(--tooltip-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tooltip-accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-section-title i {
    color: var(--tooltip-accent);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 12px;
    color: var(--tooltip-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--tooltip-text);
    text-align: right;
}

.info-value.secondary {
    font-size: 12px;
    color: var(--tooltip-muted);
}

.info-value.accent {
    color: var(--tooltip-accent);
}

.info-value.success {
    color: var(--tooltip-accent-alt);
}

/* ========================================
   LISTA DE UNIDADES INLINE
   ======================================== */

.unit-list-container {
    margin-top: 16px;
}

.unit-item {
    background: var(--tooltip-card);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--tooltip-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unit-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--tooltip-accent);
    transform: translateX(4px);
}

.unit-item-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--tooltip-text);
}

.unit-item-value {
    font-size: 12px;
    color: var(--tooltip-muted);
}

/* ========================================
   BADGES DE STATUS
   ======================================== */

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.available {
    background: rgba(16, 185, 129, 0.2);
    color: var(--tooltip-accent-alt);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.sold {
    background: rgba(239, 68, 68, 0.2);
    color: var(--tooltip-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.suspended {
    background: rgba(245, 158, 11, 0.2);
    color: var(--tooltip-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ========================================
   TABELA DE INFORMAÇÕES
   ======================================== */

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.info-table th {
    background: rgba(59, 130, 246, 0.1);
    color: var(--tooltip-accent);
    padding: 8px;
    text-align: left;
    font-weight: 700;
    border-bottom: 1px solid var(--tooltip-border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.info-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--tooltip-text);
}

.info-table td:last-child {
    text-align: right;
    color: var(--tooltip-muted);
}

/* ========================================
   BUTTONS
   ======================================== */

.tooltip-btn {
    background: var(--tooltip-accent);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tooltip-btn.secondary {
    background: var(--tooltip-card);
    color: var(--tooltip-accent);
    border: 1px solid var(--tooltip-border);
}

.tooltip-btn.secondary:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--tooltip-accent);
}

/* ========================================
   BACKDROP
   ======================================== */

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {

    .lot-tooltip-container,
    .unit-tooltip-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        border-radius: 24px 24px 0 0;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .tooltip-header-img {
        height: 200px;
    }

    .attribute-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-overlay-info h2 {
        font-size: 22px;
    }

    .header-overlay-info p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .attribute-grid {
        grid-template-columns: 1fr;
    }

    .lot-context-chips,
    .unit-context-chips {
        gap: 6px;
        padding: 12px 16px;
    }

    .ctx-chip {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    .lot-tooltip-container,
    .unit-tooltip-container,
    .attribute-card,
    .unit-item {
        animation: none;
        transition: none;
    }
}

/* ========================================
   PRINT
   ======================================== */

@media print {

    .lot-tooltip-container,
    .unit-tooltip-container {
        background: white;
        color: black;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .tooltip-header-img {
        background: #f3f4f6;
    }
}
