/* ============================================
   OFFICE ENVIRONMENT STYLES
   ============================================ */

/* Game Screen */
#game-screen {
    background: #1a1f35;
}

/* Game Footer */
.game-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 0 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 20;
}

.footer-btn {
    background: rgba(79, 70, 229, 0.3);
    border: 2px solid rgba(79, 70, 229, 0.5);
    border-radius: 12px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-btn:hover {
    background: rgba(79, 70, 229, 0.5);
    transform: scale(1.1);
}

.interaction-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(79, 70, 229, 0.2);
    border: 2px solid rgba(79, 70, 229, 0.4);
    border-radius: 12px;
    padding: 8px 25px;
}

.interaction-hint span:first-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFD700;
}

.interaction-hint span:last-child {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}

/* Game HUD */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.8) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-lg);
    z-index: 20;
    border-bottom: 1px solid var(--bg-light);
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.hud-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Player Info */
.player-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.player-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid var(--primary-light);
}

.player-details {
    display: flex;
    flex-direction: column;
}

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

.player-job {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Time Display */
.time-display {
    text-align: center;
}

#game-date {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.time-controls {
    display: flex;
    gap: var(--spacing-xs);
}

.time-btn {
    background: var(--bg-light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.time-btn:hover {
    background: var(--primary);
}

.time-btn.active {
    background: var(--primary);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Wallet Display */
.wallet-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wallet-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.wallet-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
}

/* Happiness Display */
.happiness-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.happiness-label {
    font-size: 1.2rem;
}

.happiness-bar {
    width: 80px;
    height: 8px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.happiness-fill {
    height: 100%;
    width: 80%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

/* Office Container - 3D Room */
.office-container {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 80px;
    overflow: hidden;
    background: #2d2d2d;
}

.office-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Minigame Points Overlay - floats above 3D scene */
.minigame-points-overlay {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 80px;
    pointer-events: none;
    z-index: 15;
}

.minigame-points-overlay .minigame-point {
    pointer-events: auto;
}

/* Office Furniture */
.office-desk {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 80px;
    background: linear-gradient(180deg, #5D4E37 0%, #3D3225 100%);
    border-radius: var(--radius-md);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(255,255,255,0.1);
}

.office-desk::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 60px;
    background: linear-gradient(180deg, #2a3142 0%, #1e2433 100%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 2px solid #3a4152;
}

.computer-station {
    position: absolute;
    top: -90px;
    left: 50%;
    transform: translateX(-50%);
}

.monitor {
    width: 120px;
    height: 80px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 3px solid #334155;
    border-radius: var(--radius-sm);
    position: relative;
}

.monitor::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    border-radius: 2px;
    animation: screenGlow 3s ease-in-out infinite;
}

@keyframes screenGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.monitor::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 20px;
    background: #334155;
}

.keyboard {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
    border-radius: var(--radius-sm);
}

.office-chair {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 90px;
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
    border-radius: 35px 35px 10px 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.office-chair::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: #1f2937;
    border-radius: var(--radius-full);
}

.filing-cabinet {
    position: absolute;
    bottom: 25%;
    right: 15%;
    width: 60px;
    height: 120px;
    background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.filing-cabinet::before,
.filing-cabinet::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    height: 35px;
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
    border-radius: var(--radius-sm);
}

.filing-cabinet::before { top: 10px; }
.filing-cabinet::after { top: 55px; }

.plant {
    position: absolute;
    width: 40px;
    height: 60px;
}

.plant::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 25px;
    background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
    border-radius: 5px;
}

.plant::after {
    content: '🌿';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
}

.plant.pot1 {
    bottom: 30%;
    left: 10%;
}

.plant.pot2 {
    bottom: 40%;
    right: 10%;
}

.water-cooler {
    position: absolute;
    bottom: 25%;
    left: 12%;
    width: 40px;
    height: 80px;
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 50%, #e5e7eb 50%, #d1d5db 100%);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.bookshelf {
    position: absolute;
    top: 15%;
    right: 8%;
    width: 120px;
    height: 150px;
    background: linear-gradient(180deg, #78350f 0%, #5c2d0e 100%);
    border-radius: var(--radius-sm);
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    padding: 5px;
    gap: 5px;
}

.bookshelf::before,
.bookshelf::after {
    content: '📚';
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Minigame Interaction Points */
.minigame-point {
    position: absolute;
    width: 80px;
    height: 80px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
    z-index: 10;
}

.minigame-point:hover {
    transform: scale(1.1);
}

.point-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
    filter: drop-shadow(0 0 10px rgba(79, 70, 229, 0.8));
    animation: pointPulse 2s ease-in-out infinite;
}

@keyframes pointPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.point-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: rgba(79, 70, 229, 0.9);
    padding: 5px 12px;
    border-radius: 8px;
    white-space: nowrap;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.point-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.4) 0%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Position minigame points on the isometric floor area */
#point-computer {
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
}

#point-filing {
    top: 45%;
    right: 20%;
}

#point-trash {
    top: 55%;
    left: 20%;
}

.minigame-point.completed {
    opacity: 0.4;
    pointer-events: none;
}

.minigame-point.completed .point-glow {
    display: none;
}

.minigame-point.completed .point-icon {
    animation: none;
    filter: grayscale(1);
}

/* Interaction Prompt */
.interaction-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(33, 150, 243, 0.9);
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 100;
    animation: promptPulse 1.5s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.5);
}

@keyframes promptPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 20px rgba(33, 150, 243, 0.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 6px 30px rgba(33, 150, 243, 0.7);
    }
}

.prompt-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    color: #2196F3;
    font-weight: 800;
    font-size: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.prompt-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Player Character */
.player-character {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 100px;
    z-index: 5;
}

.character-sprite {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 30px 30px 15px 15px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.character-sprite::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #fcd9b6;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.character-sprite::after {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 25px;
    background: #1e293b;
    border-radius: 50% 50% 0 0;
}

/* Action Bar */
.action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-lg);
    border-top: 1px solid var(--bg-light);
    z-index: 20;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-medium);
    border: 2px solid var(--bg-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 90px;
}

.action-btn:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: translateY(-3px);
}

.action-icon {
    font-size: 1.5rem;
}

.action-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Work Progress */
.work-progress {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    min-width: 250px;
    border: 1px solid var(--bg-light);
    z-index: 15;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.progress-bar {
    height: 12px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-tasks {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   AVATAR PROFILE DROPDOWN
   ============================================ */

.avatar-profile {
    position: relative;
}

.avatar-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    overflow: hidden;
    border: 2px solid var(--primary-light);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    font-size: 1.5rem;
}

.avatar-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 240px;
    background: var(--bg-medium);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
    border: 1px solid var(--bg-light);
}

.avatar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--bg-light);
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-light);
}

.dropdown-item.coins {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
}

.coin-balance {
    margin-left: auto;
    font-weight: 700;
    color: var(--accent);
}

.dropdown-item.logout {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--bg-light);
    margin: 5px 0;
}

/* ============================================
   SETTINGS MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-medium);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.settings-modal .modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.settings-section {
    background: var(--bg-dark);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
}

.settings-section h3 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--primary-light);
    font-size: 1rem;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    min-width: 120px;
    color: var(--text-secondary);
}

.setting-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    outline: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.setting-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.volume-value {
    min-width: 40px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.setting-row.checkbox {
    justify-content: flex-start;
}

.setting-row.checkbox label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    min-width: auto;
}

.setting-row.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.modal-footer {
    margin-top: var(--spacing-lg);
    text-align: center;
}

/* Character Builder in Settings */
.settings-gender {
    display: flex;
    gap: var(--spacing-sm);
}

.settings-gender .gender-btn {
    padding: 8px 20px;
    border: 2px solid var(--bg-light);
    background: var(--bg-dark);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.settings-gender .gender-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.settings-gender .gender-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#character-builder-section .skin-tone-selector,
#character-builder-section .hair-color-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#character-builder-section .skin-swatch,
#character-builder-section .hair-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

#character-builder-section .skin-swatch:hover,
#character-builder-section .hair-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

#character-builder-section .skin-swatch.selected,
#character-builder-section .hair-swatch.selected {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

#character-builder-section .outfit-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#character-builder-section .outfit-btn {
    padding: 8px 16px;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

#character-builder-section .outfit-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

#character-builder-section .outfit-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
