@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

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

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    overflow: hidden; /* App-like feel */
}

/* Scrollbars personalizadas */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #1e293b;
}
::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Utilitários de Layout */
.dock-bottom-left {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Deixa passar cliques para o mapa */
}
.dock-bottom-left > * {
    pointer-events: auto; /* Reativa cliques nos filhos */
}

/* Componente: Barra de Recursos */
.resources-bar {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    width: 280px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: #e2e8f0;
    font-size: 0.9rem;
}
.resources-bar h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #f8fafc;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
}

.resources-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.res-row {
    display: grid;
    grid-template-columns: 28px 1fr 120px 80px;
    align-items: center;
    gap: 10px;
}

.res-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #1f2937;
    object-fit: contain;
    padding: 2px;
}

.res-label {
    color: #cbd5e1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.res-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #0b1220;
    color: #e2e8f0;
    font-family: monospace;
    font-size: 0.9rem;
    text-align: right;
}
.res-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.res-actions {
    display: flex;
    gap: 6px;
}

/* Botões */
.btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn.small {
    padding: 4px 8px;
    font-size: 0.8rem;
}
.btn-primary {
    background: #3b82f6;
    color: white;
}
.btn-primary:hover {
    background: #2563eb;
}
.btn-secondary {
    background: #475569;
    color: white;
}
.btn-secondary:hover {
    background: #334155;
}
.btn-success {
    background: #10b981;
    color: white;
}
.btn-success:hover {
    background: #059669;
}

.resources-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #334155;
}

/* Mapa e Wrapper */
.map-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    overflow: hidden;
    cursor: grab;
    background-color: #0f172a; /* Fundo escuro por padrão */
}
.map-wrapper:active {
    cursor: grabbing;
}

.map-content {
    will-change: transform;
    transform-origin: 0 0;
    position: absolute;
    top: 0;
    left: 0;
}

.map-content > img {
    user-select: none;
    pointer-events: none;
    display: block;
    max-width: none;
    /* Com display:block, não há baseline gap; vertical-align seria ignorado */
}

/* Camada de Lotes */
#lotesContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Deixa passar cliques para o mapa se não acertar um lote */
    z-index: 10;
}

/* Estilo para um lote individual (exemplo) */
.lote {
    position: absolute;
    border: none;
    background: transparent;
    pointer-events: auto; /* Lotes são clicáveis */
    cursor: pointer;
}
.lote:hover {
    background: transparent;
    border-color: transparent;
}
.lote.ocupado {
    background: transparent;
    border-color: transparent;
}
.lote.meu {
    background: transparent;
    border-color: transparent;
}
