/* UI Styles for Shadowhold */

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    z-index: 1000;
}

/* Event Notifications Container */
.event-notifications-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 80%;
    width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
    pointer-events: none;
    max-height: 70vh;
    overflow-y: hidden;
    overflow-x: hidden;
}

/* Event Notification Base Style */
.event-notification {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 12px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    backdrop-filter: blur(3px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
    animation: slideIn 0.3s ease-out;
    opacity: 1;
    transition: opacity 0.5s, transform 0.5s;
    max-width: 500px;
    line-height: 1.4;
}

.event-notification.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

/* Notification Icons */
.notification-icon {
    margin-right: 12px;
    font-size: 20px;
    flex-shrink: 0;
}

/* Notification Text */
.notification-text {
    flex: 1;
    font-size: 14px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Combat Hit Notification */
.combat-hit-notification {
    background-color: rgba(139, 0, 0, 0.75);
    border-left: 3px solid #ff0000;
}

/* Combat Kill Notification */
.combat-kill-notification {
    background-color: rgba(128, 0, 128, 0.75);
    border-left: 3px solid #ff00ff;
}

/* Damage Taken Notification */
.damage-taken-notification {
    background-color: rgba(255, 0, 0, 0.65);
    border-left: 3px solid #ff6600;
}

/* Pickup Notification */
.pickup-notification {
    background-color: rgba(0, 100, 0, 0.75);
    border-left: 3px solid #00ff00;
}

/* Level Change Notification */
.level-change-notification {
    background-color: rgba(25, 25, 112, 0.75);
    border-left: 3px solid #00ffff;
}

/* Warning Notification */
.warning-notification {
    background-color: rgba(184, 134, 11, 0.75);
    border-left: 3px solid #ffff00;
}

/* Info Notification */
.info-notification {
    background-color: rgba(0, 0, 139, 0.75);
    border-left: 3px solid #1e90ff;
}

/* Notification Animation */
@keyframes slideIn {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Stats Display */
.stats-display {
    flex: 3;
    display: flex;
    flex-direction: column;
    padding: 10px;
    color: white;
    font-family: 'Courier New', monospace;
}

/* Health, Mana, Armor Containers */
.health-container, .mana-container, .armor-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

/* Stat Labels */
.health-label, .mana-label, .armor-label {
    width: 80px;
    font-size: 14px;
}

.health-label {
    color: #ff0000;
}

.mana-label {
    color: #00aaff;
}

.armor-label {
    color: #00ff00;
}

/* Bar Containers */
.bar-outer {
    flex: 1;
    height: 15px;
    background-color: #333;
    border: 1px solid #555;
}

/* Progress Bars */
.health-bar, .mana-bar, .armor-bar {
    height: 100%;
    background-color: #ff0000;
}

.mana-bar {
    background-color: #00aaff;
}

.armor-bar {
    background-color: #00ff00;
}

/* Stat Values */
.health-value, .mana-value, .armor-value {
    width: 40px;
    text-align: right;
    margin-left: 10px;
    font-size: 14px;
}

/* Loot Container */
.loot-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    color: white;
    font-family: 'Courier New', monospace;
    align-items: center;
    gap: 5px;
}

/* Loot Counter */
.loot-counter {
    font-size: 16px;
    color: #ffd700;
}

/* Level Indicator */
.level-indicator {
    font-size: 16px;
    color: #ffd700;
}

/* Gold and Gems Counters - Keeping old class names for compatibility but not using them */
.gold-counter {
    font-size: 16px;
    color: #ffd700;
}

/* Removing gems counter - commented out for reference */
/* 
.gems-counter {
    font-size: 14px;
    color: #ff00ff;
}
*/

/* Spell Slots */
.spell-slots {
    flex: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.spell-slot {
    width: 50px;
    height: 50px;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    pointer-events: auto;
}

.spell-slot.active {
    border-color: #00aaff;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.6);
}

.slot-number {
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 10px;
    color: white;
}

.slot-icon {
    width: 40px;
    height: 40px;
    background-color: #222;
    opacity: 0.5;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.slot-icon.active {
    background-color: transparent;
    opacity: 1.0;
}

/* Add touch feedback */
.spell-slot:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.8);
}

/* Weapon Display */
.weapon-display {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.weapon-name {
    position: absolute;
    top: 10px;
    font-size: 12px;
    color: white;
}

.weapon-image {
    width: 100px;
    height: 70px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Notification Area */
.notification-area {
    position: fixed;
    top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 1000;
}

/* Weapon Overlays */
.melee-overlay {
    position: fixed;
    bottom: 0;
    right: 50%;
    margin-right: -500px;
    width: 600px;
    height: 600px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right bottom;
    z-index: 900;
    pointer-events: none;
}

.spell-overlay {
    position: fixed;
    bottom: 0;
    left: 50%;
    margin-left: -500px;
    width: 600px;
    height: 600px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left bottom;
    z-index: 900;
    pointer-events: none;
}

/* Death Screen */
.death-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(128, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    display: none;
}

.death-title {
    color: #ff0000;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px #000;
}

.respawn-text {
    font-size: 24px;
    color: white;
    margin-top: 20px;
    text-shadow: 2px 2px 4px #000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Damage and Healing Indicators */
.damage-indicator {
    color: #ff0000;
    font-size: 24px;
    font-weight: bold;
    opacity: 1;
    transition: all 0.5s ease-out;
    margin: 5px;
}

.heal-indicator {
    color: #00ff00;
    font-size: 24px;
    font-weight: bold;
    opacity: 1;
    transition: all 0.5s ease-out;
    margin: 5px;
}

/* Notifications */
.notification {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.not-enough-mana {
    background-color: rgba(0, 100, 255, 0.5);
    color: white;
}

.pickup-message {
    background-color: rgba(50, 200, 50, 0.5);
    color: white;
}

.regen-tick {
    background-color: rgba(50, 200, 50, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
    margin-bottom: 5px;
}

.spell-learned-indicator {
    color: #00ffff;
    font-size: 22px;
    font-weight: bold;
    opacity: 1;
    transition: all 1s ease-out;
    margin: 5px;
    background-color: rgba(0, 0, 50, 0.5);
    padding: 10px;
    border-radius: 5px;
}

/* Animations */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20px); }
}

@keyframes fadeUp {
    0% { opacity: 0.8; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-15px); }
}

/* Loading Screen */
#init-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    background-image: linear-gradient(to bottom, #000000, #111111, #1a1111);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 3000;
    color: white;
    padding: 30px;
    box-sizing: border-box;
    transition: opacity 1s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.title-container {
    position: relative;
    width: 600px;
    height: 900px;
    max-width: 90%;
    background-image: url('../sprites/title8bit.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 20px;
}

.game-title {
    width: auto;
    max-width: 90%;
    height: auto;
    display: block;
    margin-bottom: 0;
}

.intro-text {
    font-size: 18px;
    max-width: 600px;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.5;
    color: #cccccc;
    font-family: 'Courier New', monospace;
}

.controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(50, 50, 50, 0.5);
    padding: 20px;
    border-radius: 0 0 10px 10px;
    z-index: 2;
    box-sizing: border-box;
}

.controls-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: #ffffff;
    letter-spacing: 2px;
    font-size: 18px;
}

.controls-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.control-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    width: 100%;
}

.key {
    background-color: #222222;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 12px;
    min-width: 110px;
    width: 110px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border: 1px solid #444444;
    box-sizing: border-box;
}

.desc {
    color: #dddddd;
    font-family: 'Courier New', monospace;
    flex: 1;
    font-size: 14px;
}

.enter-prompt {
    font-size: 28px;
    color: #ffffff;
    margin-top: 20px;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px #ffffff;
}

.enter-prompt.ready {
    color: #00ff00;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.start-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.start-button {
    background-color: #880000;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 15px 30px;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.start-button:hover {
    background-color: #aa0000;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.7);
}

.start-button:active {
    background-color: #cc0000;
    transform: scale(0.98);
}

.start-button:disabled {
    background-color: #555555;
    color: #aaaaaa;
    cursor: not-allowed;
    box-shadow: none;
}

/* Mobile Controls */
.mobile-only {
    display: none; /* Hidden by default */
}

/* Only show mobile controls on touch devices without any scaling */
@media (pointer: coarse) {
    .mobile-only {
        display: block;
    }
}

/* Proper viewport handling for mobile devices */
@media screen and (max-width: 1024px) {
    html, body {
        height: 100%;
        width: 100%;
        overflow: hidden; /* Reverted */
        touch-action: none; /* Reverted */
    }
    
    body {
        position: fixed; /* Reverted */
    }
    
    .title-container {
        width: 480px;
        height: 720px;
    }
    
    .controls-container {
        padding: 10px;
    }
    
    .controls-list {
        gap: 5px;
    }
    
    .key {
        min-width: 95px;
        width: 95px;
        font-size: 12px;
    }
    
    .desc {
        font-size: 12px;
    }
    
    .start-container {
        margin-bottom: 30px;
    }
    
    #init-screen {
        padding: 20px;
    }
}

#mobile-controls {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 900;
}

.joystick-zone {
    position: absolute;
    width: 200px !important;
    height: 200px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto;
    transform: translate(-50%, 50%);
    z-index: 920;
}

/* Add a visual center indicator to the joystick zones */
.joystick-zone::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 50%;
    bottom: 50%;
    transform: translate(-50%, 50%);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

#movement-joystick {
    left: 120px;
    bottom: 40%;
}

#look-joystick {
    right: 120px;
    bottom: 40%;
    transform: translate(50%, 50%);
}

.action-button {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.7);
    color: white;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    bottom: 160px;
    z-index: 1100;
}

#attack-btn {
    width: 160px;
    height: 160px;
    right: 80px;
    background-color: rgba(231, 76, 60, 0.4);
    border-color: rgba(231, 76, 60, 0.8);
}

#spell-btn {
    width: 160px;
    height: 160px;
    left: 80px;
    background-color: rgba(52, 152, 219, 0.4);
    border-color: rgba(52, 152, 219, 0.8);
}

#map-btn {
    width: 80px;
    height: 80px;
    background-color: rgba(139, 69, 19, 0.4);
    border-color: rgba(139, 69, 19, 0.8);
    left: calc(50% - 90px);
    transform: translateX(-50%);
}

#interact-btn {
    width: 80px;
    height: 80px;
    left: calc(50% + 10px);
    transform: translateX(-50%);
    background-color: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.8);
}

/* Intro screen landscape adjustments should be merged with the existing landscape mode adjustments */
@media (pointer: coarse) and (orientation: landscape) {
    /* Status bar adjustments */
    .status-bar {
        height: 60px;
    }
    
    /* Notification adjustments */
    .event-notifications-container {
        max-width: 50%;
        width: 300px;
        top: 10px;
    }
    
    .event-notification {
        padding: 6px 8px;
        margin-bottom: 5px;
        font-size: 10px;
    }
    
    .notification-icon {
        margin-right: 6px;
        font-size: 12px;
    }
    
    .notification-text {
        font-size: 10px;
    }
    
    /* First-person weapon overlay size reductions */
    .melee-overlay, .spell-overlay {
        width: 300px;
        height: 300px;
    }
    
    .melee-overlay {
        margin-right: -250px;
    }
    
    .spell-overlay {
        margin-left: -250px;
    }
    
    /* Scale adjustments for landscape mode */
    .joystick-zone {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Restore original landscape mode styling */
    .action-button {
        width: 110px;
        height: 110px;
        font-size: 20px;
    }
    
    #interact-btn {
        width: 80px;
        height: 80px;
        font-size: 16px;
        left: calc(50% + 10px);
        bottom: 120px;
    }
    
    #map-btn {
        width: 80px;
        height: 80px;
        font-size: 16px;
        left: calc(50% - 70px);
        bottom: 120px;
    }
    
    /* Action button positioning adjustments */
    #attack-btn {
        width: 110px;
        height: 110px;
        right: 10%;
        bottom: 120px;
        background-color: rgba(231, 76, 60, 0.4);
    }
    
    #spell-btn {
        width: 110px;
        height: 110px;
        left: 10%;
        bottom: 120px;
        background-color: rgba(52, 152, 219, 0.4);
    }
    
    /* Joystick positioning adjustments - fixed distance from action buttons */
    #movement-joystick {
        bottom: 290px; /* 120px (action button bottom) + 110px (button height) + 60px (spacing) */
        left: 20%;
        transform: translate(-50%, 50%);
    }
    
    #look-joystick {
        bottom: 290px;
        right: 20%;
        transform: translate(50%, 50%);
    }
    
    /* Mobile spell selector adjustments */
    #mobile-spell-selector {
        top: 5px;
    }
    
    .spell-selector-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .mobile-spell-slots {
        gap: 5px;
        padding: 5px;
    }
    
    .mobile-spell-slot {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    /* Init screen landscape adjustments */
    #init-screen {
        overflow-y: auto;
        overflow-x: hidden;
        justify-content: flex-start;
        padding: 15px;
    }
    
    /* Adjust title container for landscape */
    .title-container {
        width: 60%; /* Base width on viewport */
        max-width: 480px; /* Limit max width */
        height: auto;
        aspect-ratio: 500 / 750; /* Original image aspect ratio (500x750) */
        margin: 0 auto 15px auto; /* Center and add bottom margin */
        /* Keep background properties */
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    /* Ensure controls are still visible and properly sized */
    .controls-container {
        padding: 10px;
    }
    
    .controls-container h2 {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .controls-list {
        gap: 5px;
    }
    
    .control-item {
        padding: 3px 0;
    }
    
    /* Key and desc adjustments for landscape */
    .key {
        min-width: 95px;
        width: 95px;
        font-size: 12px;
    }
    
    .desc {
        font-size: 12px;
    }
    
    /* Other landscape adjustments */
    .intro-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .start-container {
        margin-bottom: 15px;
        gap: 10px;
    }
    
    .start-button {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .enter-prompt {
        font-size: 16px;
    }
}

/* Custom joystick styling */
.nipple {
    opacity: 0.8 !important;
}

.nipple .front, .nipple .back {
    background-color: rgba(255, 255, 255, 0.7) !important;
}

/* Mobile Spell Selector */
#mobile-spell-selector {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    z-index: 950;
}

.spell-selector-title {
    color: white;
    font-size: 18px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #000;
    font-family: 'Courier New', monospace;
}

.mobile-spell-slots {
    display: flex;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 15px;
}

.mobile-spell-slot {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background-color: rgba(0, 100, 255, 0.2);
    border: 2px solid rgba(0, 100, 255, 0.4);
    color: white;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    -webkit-tap-highlight-color: transparent;
    background-size: cover;
    background-position: center;
}

.mobile-spell-slot.active {
    background-color: rgba(0, 100, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.7);
}

/* Ensure weapon overlays stay behind buttons */
.melee-overlay, .spell-overlay {
    z-index: 899;
}

/* Crosshair */
.crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1000;
}

/* Remove the pseudo-elements and dot that were used for the plus crosshair */
/*
.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
}

.crosshair::before {
    left: 50%;
    top: 0;
    width: 2px;
    height: 16px;
    transform: translateX(-50%);
}

.crosshair::after {
    top: 50%;
    left: 0;
    height: 2px;
    width: 16px;
    transform: translateY(-50%);
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}
*/

/* Minimap styles */
#minimap-container {
  opacity: 0.9;
  transition: opacity 0.2s ease-in-out;
}

#minimap-container:hover {
  opacity: 1;
}

#minimap-title {
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
  color: #4b3621;
}

#minimap {
  display: block;
}

/* Minimap landscape adjustments */
@media (pointer: coarse) and (orientation: landscape) {
  #minimap-container {
    transform: scale(0.6);
    transform-origin: top right;
  }
  
  #minimap-title {
    font-size: 12px;
    padding: 3px;
  }
} 