/* ===========================
   Settlemire — Game HUD Styles
   Mobile-first design
   =========================== */

/* --- Resource Bar (top) --- */
.settlement-resources {
    position: fixed;
    top: 48px; /* below game header */
    left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    background: rgba(13, 13, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 52;
    font-size: 0.85rem;
    font-weight: 600;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #eeeef2;
}

.resource-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.resource-count {
    font-variant-numeric: tabular-nums;
    min-width: 24px;
    transition: color 0.3s;
}

.resource-count.gained {
    color: #22c55e;
}

/* --- Population Badge --- */
.settlement-pop {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #9898b0;
    font-size: 0.8rem;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.settlement-pop i {
    color: #06b6d4;
}

/* --- Bottom Action Panel --- */
.settlement-panel {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(13, 13, 20, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 14px 16px;
    z-index: 52;
    transition: transform 0.3s ease;
    max-height: 45vh;
    overflow-y: auto;
}

.settlement-panel.hidden {
    transform: translateY(100%);
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #eeeef2;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: #06b6d4;
}

.panel-subtitle {
    font-size: 0.75rem;
    color: #9898b0;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* --- Action Buttons --- */
.settlement-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 44px; /* mobile touch target */
}

.settlement-btn-primary {
    background: #06b6d4;
    color: #000;
}

.settlement-btn-primary:hover {
    background: #0891b2;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.settlement-btn-primary:disabled {
    background: #1a1a2a;
    color: #5a5a72;
    cursor: not-allowed;
    box-shadow: none;
}

.settlement-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.settlement-btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.settlement-btn-ghost {
    background: rgba(255,255,255,0.05);
    color: #9898b0;
    border: 1px solid rgba(255,255,255,0.08);
}

.settlement-btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    color: #eeeef2;
}

.settlement-btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-height: 36px;
    width: auto;
}

/* --- Cost Display --- */
.cost-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.85rem;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cost-item.affordable {
    color: #22c55e;
}

.cost-item.expensive {
    color: #ef4444;
}

/* --- Worker List --- */
.worker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.worker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 0.8rem;
}

.worker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.worker-dot.idle { background: #9898b0; }
.worker-dot.walking_to { background: #f59e0b; }
.worker-dot.mining { background: #22c55e; }
.worker-dot.walking_back { background: #06b6d4; }

.worker-status {
    flex: 1;
    color: #9898b0;
}

.worker-action-btn {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    min-height: 28px;
}

/* --- Toast Notifications --- */
.settlement-toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.settlement-toast {
    padding: 8px 18px;
    border-radius: 8px;
    background: rgba(13, 13, 20, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    color: #eeeef2;
    font-size: 0.8rem;
    font-weight: 500;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    white-space: nowrap;
}

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

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

/* --- Base Placement Overlay --- */
.placement-overlay {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(13, 13, 20, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(6, 182, 212, 0.3);
    padding: 20px 16px;
    z-index: 55;
    text-align: center;
}

.placement-overlay h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: #eeeef2;
}

.placement-overlay p {
    font-size: 0.8rem;
    color: #9898b0;
    margin-bottom: 14px;
    line-height: 1.4;
}

/* --- Player Info Card --- */
.player-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.player-info-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.player-info-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.player-info-tier {
    font-size: 0.75rem;
    color: #9898b0;
}

/* --- Owner Reset Button --- */
.reset-btn-container {
    position: fixed;
    top: 96px;
    right: 8px;
    z-index: 60;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .settlement-resources {
        gap: 10px;
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    
    .settlement-panel {
        padding: 12px 12px;
    }
}

@media (min-width: 900px) {
    .settlement-panel {
        max-width: 400px;
        left: auto;
        right: 16px;
        bottom: 16px;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,0.08);
    }
    
    .settlement-resources {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 12px 12px;
        right: auto;
    }
}
