/* VillageQuest - Village Quiz Adventure 3D
 * Extracted from VillageQuest.html for better maintainability
 */

/* ========================================
   Base Styles
   ======================================== */

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #000;
}

/* ========================================
   UI Overlay
   ======================================== */

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#hud {
    padding: 20px;
    color: white;
    text-shadow: 2px 2px 0 #000;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#interaction-prompt {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: none;
    font-size: 18px;
    pointer-events: auto;
    text-align: center;
}

#controls-hint {
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 1px 1px 0 #000;
    font-size: 14px;
}

#active-objective {
    margin-top: 10px;
}

/* ========================================
   Modals
   ======================================== */

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 25, 40, 0.95);
    color: white;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #4a90e2;
    width: 400px;
    max-width: 90%;
    display: none;
    pointer-events: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal h2 {
    margin-top: 0;
    color: #ffd700;
}

/* ========================================
   Buttons
   ======================================== */

button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

button:hover {
    background: #357abd;
}

button:disabled {
    background: #555;
    cursor: not-allowed;
}

.option-btn {
    display: block;
    width: 100%;
    margin: 10px 0;
    text-align: left;
}

.panel-button {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.panel-button:hover {
    background: #357abd;
}

.panel-button.secondary {
    background: #555;
}

.panel-button.secondary:hover {
    background: #666;
}

.panel-button.success {
    background: #4caf50;
}

.panel-button.success:hover {
    background: #45a049;
}

/* ========================================
   Map Overlay
   ======================================== */

#map-button {
    pointer-events: auto;
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 5;
}

#sets-button {
    pointer-events: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#sets-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#map-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 15, 25, 0.92);
    border: 2px solid #4a90e2;
    border-radius: 12px;
    padding: 12px;
    display: none;
    pointer-events: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

#map-overlay h3 {
    margin: 4px 0 8px 0;
    color: #ffeb3b;
    text-align: center;
}

#map-canvas {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.35), rgba(0, 80, 20, 0.65));
    border-radius: 8px;
}

/* ========================================
   Collapsible Panel System
   ======================================== */

#panel-stack {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 320px;
    max-width: 90vw;
    pointer-events: none;
}

.collapsible-panel {
    position: relative;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-radius: 12px;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(74, 144, 226, 0.5);
    transition: all 0.3s ease;
    overflow: hidden;
}

.collapsible-panel.minimized {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    cursor: pointer;
}

.collapsible-panel.minimized .panel-content {
    display: none;
}

.collapsible-panel.minimized .panel-header h3 {
    display: none;
}

.collapsible-panel.minimized .panel-header {
    border: none;
    background: transparent;
    padding: 0;
}

.collapsible-panel.minimized .panel-icon-minimized {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(74, 144, 226, 0.2);
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    cursor: pointer;
    user-select: none;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #ffeb3b;
    text-shadow: 1px 1px 2px #000;
}

.panel-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.panel-toggle:hover {
    transform: scale(1.2);
}

.panel-icon-minimized {
    display: none;
    font-size: 28px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.panel-content {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.5);
    border-radius: 3px;
}

/* ========================================
   Multiplayer Panel
   ======================================== */

#multiplayer-panel {
    width: 100%;
}

#multiplayer-panel.minimized {
    width: 50px !important;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 13px;
}

.player-item.self {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.session-info {
    background: rgba(74, 144, 226, 0.15);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
}

.session-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    color: #4a90e2;
    letter-spacing: 2px;
}

.set-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 13px;
}

.set-item-icon {
    font-size: 18px;
    margin-right: 8px;
}

.set-item-name {
    flex: 1;
}

.set-item-count {
    color: #aaa;
    font-size: 11px;
}

.sets-summary {
    background: rgba(255, 193, 7, 0.15);
    padding: 10px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 12px;
    text-align: center;
    color: #ffeb3b;
    font-weight: 600;
}

/* ========================================
   Objectives Panel
   ======================================== */

#objectives-panel {
    width: 100%;
    max-width: 280px;
}

#objectives-panel.minimized {
    width: 50px !important;
    max-width: 50px !important;
}

.objective-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.objective-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.objective-card.active {
    border-color: #4caf50;
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.4);
}

.objective-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.objective-desc {
    font-size: 12px;
    color: #e0e0e0;
    margin-bottom: 6px;
}

.objective-status {
    font-size: 12px;
    margin-top: 4px;
}

.objective-status span {
    font-weight: 700;
}

/* ========================================
   Set Selector Modal
   ======================================== */

.category-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(74, 144, 226, 0.5);
}

.category-tab.active {
    background: rgba(74, 144, 226, 0.4);
    border-color: #4a90e2;
}

.set-checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.set-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(74, 144, 226, 0.4);
}

.set-checkbox-item.selected {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

.set-checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.set-checkbox-label {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.set-checkbox-icon {
    font-size: 18px;
    margin-right: 8px;
}

.set-checkbox-info {
    flex: 1;
}

.set-checkbox-name {
    font-size: 14px;
    font-weight: 600;
}

.set-checkbox-meta {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

/* ========================================
   Notification Banner
   ======================================== */

#notification-banner {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#notification-banner.show {
    opacity: 1;
}

#notification-banner.fade-out {
    opacity: 0;
}
