/* CSS Reset */
@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Removed flicker animation */

html, body {
    width: 100%;
    height: 100vh;
    font-family: 'Press Start 2P', monospace; /* Retro-themed font */
    font-size: 16px;
    line-height: 1.5;
    background-color: #000; /* Black background for retro theme */
    color: #0f0; /* Neon green text for retro theme */
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Neon glow effect */
    display: grid;
    place-items: center;
    overflow: hidden; /* Prevent horizontal scrolling */
    /* Removed flicker animation */
    
    /* Touch device optimizations */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;

    /* Add CRT scanline effect */
    background-image: 
        repeating-linear-gradient(
            rgba(0, 0, 0, 0.2) 0px,
            rgba(0, 0, 0, 0.2) 1px,
            rgba(0, 255, 0, 0.02) 2px
        );
    background-size: 100% 4px;
    background-repeat: repeat;
}

/* CSS Grid Layout for Container */
.container {
    display: grid;
    grid-template-rows: auto 1fr auto; /* Header, Main, Footer */
    grid-template-columns: 1fr; /* Single column layout */
    width: 100%;
    height: 100vh; /* Full viewport height */
}

img, picture, video, canvas {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    font-family: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}

/* Header */
.header {
    background-color: #000; /* Retro black background */
    border-bottom: 2px solid #0f0; /* Neon green border */
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 1000;
    position: relative;
}



.nav-list {
    display: flex;
    justify-content: space-around; /* Space tabs evenly */
    list-style: none;
}

.nav-item {
    font-size: 1.2rem;
    color: #0f0; /* Neon green text for retro theme */
    text-decoration: none;
    text-transform: uppercase; /* Make text uppercase for retro feel */
    padding: 10px 15px;
    transition: all 0.3s ease-in-out; /* Smooth transition */
    
    /* Touch optimizations */
    -webkit-tap-highlight-color: rgba(0, 255, 0, 0.2);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-item:hover {
    color: #fff; /* Change text to white on hover */
    background-color: rgba(0, 255, 0, 0.2); /* Add a slight glow effect */
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5); /* Subtle glowing shadow */
}

.nav-item.active {
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Add glow effect to active tab */
    border-bottom: 2px solid #0f0; /* Highlight active tab */
}

/* Improved Focus Accessibility and Touch Support */
.nav-item:focus,
.radio-station:focus,
.inventory-item:focus {
    outline: 2px solid #0f0;
    background-color: rgba(0, 255, 0, 0.2);
}

/* Touch optimizations for interactive elements */
.inventory-item,
.radio-station,
.quest-marker {
    -webkit-tap-highlight-color: rgba(0, 255, 0, 0.2);
    cursor: pointer;
}

.inventory-item {
    min-height: 60px;
}

.radio-station {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px;
}

/* Hide all tab contents by default */
.tab-content {
    text-align: center; /* Center-align text for sections */
    padding: 20px;
    border: 2px solid #0f0; /* Neon green border for sections */
    border-radius: 10px; /* Rounded corners for sections */
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); /* Subtle glowing shadow */
    opacity: 0; /* Start with full transparency */
    visibility: hidden; /* Hide from screen readers and prevent interaction */
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out; /* Smooth fade transitions */
    position: absolute; /* Ensure tab contents do not overlap */
    width: calc(100% - 44px); /* Учитываем border и padding */
    height: calc(100% - 44px); /* Учитываем border и padding */
    overflow-y: auto; /* Enable vertical scrolling */
    top: 0;
    left: 0;
    box-sizing: border-box;
}

/* Специальные стили для секции карты */
#map.tab-content {
    padding: 0;
    border: 2px solid #0f0; /* Neon green border как у других разделов */
    border-radius: 10px; /* Rounded corners как у других разделов */
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); /* Subtle glowing shadow как у других разделов */
    width: calc(100% - 4px); /* Учитываем только border */
    height: calc(100% - 4px); /* Учитываем только border */
}

/* Предупреждение о повороте экрана */
.orientation-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.orientation-warning.visible {
    display: flex;
}

.orientation-warning-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    border: 3px solid #0f0;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.6);
}

.orientation-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate 2s infinite ease-in-out;
}

.orientation-warning h2 {
    color: #0f0;
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.orientation-warning p {
    color: #0f0;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    line-height: 1.6;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    75% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

/* Показываем предупреждение только на мобильных устройствах в портретном режиме */
@media (orientation: portrait) and (max-width: 768px) {
    .orientation-warning.visible {
        display: flex;
    }
}

@media (orientation: landscape) {
    .orientation-warning.visible {
        display: none !important;
    }
}

/* Show the active tab content */
.tab-content.active {
    opacity: 1; /* Fully visible */
    visibility: visible; /* Allow interaction */
    position: relative; /* Properly position active tab */
    z-index: 1; /* Ensure it's on top */
    overflow-y: auto; /* Allow scrolling for active tab */
}

/* Utility Classes */
.neon-text {
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.neon-border {
    border: 2px solid #0f0;
}

/* Main Content */
.main-content {
    display: grid; /* Use CSS Grid for layout */
    grid-template-rows: auto; /* Allow rows to adjust dynamically */
    grid-template-columns: 1fr; /* Single-column layout for sections */
    gap: 20px; /* Space between sections */
    padding: 20px; /* Padding around the container */
    width: 100%; /* Full width for main content */
    height: 100%; /* Full height for main content */
    overflow-y: auto; /* Enable vertical scrolling if content exceeds container height */
    position: relative; /* For absolute-positioned tab contents */
    overflow: hidden; /* Avoid overflow from hidden tabs */
}

/* Footer removed */

/* Pip-Boy buttons removed */

/* Old stats styling removed - now using special-stats.css */

/* Progress bar styles removed - no longer needed for SPECIAL stats */

/* Tooltip Styling */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black background */
    color: #0f0; /* Neon green text */
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Glowing effect */
    visibility: hidden; /* Hide by default */
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000; /* Ensure tooltip is above other elements */
    max-width: 200px; /* Ensure tooltips don't overflow on small screens */
    word-wrap: break-word; /* Break long tooltip text for better fit */
}

/* Show Tooltip */
.tooltip.visible {
    visibility: visible;
    opacity: 1;
}

/* Inventory Section Styling */
#inventory {
    text-align: center;
    padding: 20px;
    border: 2px solid #0f0;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); /* Glowing effect */
    background-color: rgba(0, 0, 0, 0.8); /* Slight transparency */
}

/* Inventory Grid Layout */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive grid */
    gap: 20px; /* Space between items */
    margin-top: 20px;
}

/* Inventory Item Styling */
.inventory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 2px solid #0f0; /* Neon green border */
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.9); /* Slight transparency */
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); /* Glowing effect */
    text-align: center;
}

/* Item Icon */
.item-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

/* Item Details */
.item-details {
    font-family: 'Press Start 2P', monospace; /* Retro font */
    font-size: 0.8rem;
    color: #0f0; /* Neon green text */
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Glow effect */
}

.item-name {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.item-weight,
.item-value {
    font-size: 0.8rem;
    margin: 3px 0;
}

#search-bar {
    width: 80%;
    margin: 10px auto 20px;
    padding: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    border: 2px solid #0f0;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #0f0;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Neon effect */
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); /* Glowing border */
}


/* Side Panel */
.side-panel {
    position: fixed; /* Fixed position ensures it's independent of layout */
    right: 0;
    top: 0;
    width: 300px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Retro black */
    border-left: 2px solid #0f0; /* Neon green border */
    box-shadow: -5px 0 10px rgba(0, 255, 0, 0.5); /* Glowing effect */
    color: #0f0; /* Neon green text */
    font-family: 'Press Start 2P', monospace;
    padding: 20px;
    transform: translateX(100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out; /* Smooth slide-in/out */
    z-index: 2000; /* Higher than the header */
}

.side-panel.hidden {
    transform: translateX(100%);
}

.side-panel.visible {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f0;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.close-button {
    font-size: 1.5rem;
    color: #0f0;
    background: none;
    border: none;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.item-details-icon {
    width: 100%;
    margin-bottom: 15px;
    border: 2px solid #0f0;
    border-radius: 5px;
}

.item-details-description,
.item-details-weight,
.item-details-value {
    margin: 10px 0;
}

/* Hover Effect */
.inventory-item {
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

.inventory-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5); /* Add a glowing effect */
}

/* Map Section styling */
.map-container {
    position: relative;
    text-align: center;
    width: 100%;
    height: 100%;
    border: none; /* Убираем border чтобы избежать двойных границ */
    border-radius: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Yandex Map Container */
.yandex-map-container {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px; /* Чуть меньше чем у секции для правильного отображения */
    overflow: hidden;
}

.interactive-map {
    cursor: pointer;
    width: 100%;
    height: auto;
    background-color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    border: 2px solid #0f0;
    border-radius: 10px;
    cursor: grab; /* Indicate draggable content */
    touch-action: pan-x pan-y; /* Enable panning */
}



.quest-marker:hover {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8)); /* Glow effect */
}

.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    color: #fff; /* White text */
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Glow effect */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
}

.tooltip.visible {
    visibility: visible;
    opacity: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden; /* Hidden by default */
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}

.modal.visible {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: #222; /* Dark modal background */
    border: 2px solid #0f0; /* Neon green border */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8); /* Glowing effect */
    padding: 20px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    color: #0f0;
    font-family: 'Press Start 2P', monospace;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #0f0;
    font-size: 1.5rem;
    cursor: pointer;
}

#user-location {
    filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.8)); /* Glow effect */
    stroke: #fff; /* White outline for visibility */
    stroke-width: 2;
    animation: pulse 1.5s infinite; /* Pulsating animation */
}

@keyframes pulse {
    0%, 100% {
        r: 10; /* Default radius */
    }
    50% {
        r: 15; /* Expanded radius */
    }
}

.map-instructions {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #0f0;
    margin-top: 10px;
    height: 20px;
    line-height: 20px;
    text-align: center;
}

/* Radio Section Styling */
.radio-container {
    width: 100%;
    margin: 20px auto;
    text-align: center;
    color: #0f0; /* Neon green text for retro theme */
    font-family: 'Press Start 2P', monospace;
    box-sizing: border-box;
}

.radio-placeholder {
    margin-bottom: 20px;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Glowing effect */
}

.radio-list {
    list-style: none;
    padding: 0;
}

.radio-station {
    font-size: 1.2rem;
    padding: 10px 20px;
    margin: 10px 0;
    border: 2px solid #0f0; /* Neon green border */
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.8); /* Retro black background */
    cursor: pointer;
    transition: all 0.3s ease-in-out; /* Smooth hover effect */
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Glowing text */
}

.radio-station:hover {
    background-color: #0f0; /* Neon green highlight */
    color: #000; /* Invert text color for contrast */
    box-shadow: 0 0 15px rgba(0, 255, 0, 1); /* Glowing effect */
    transform: scale(1.05); /* Slight zoom effect */
}

.radio-station:active {
    transform: scale(0.95); /* Button press effect */
}

.currently-playing {
    margin-top: 20px;
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 1); /* Strong glow */
}

.radio-description {
    margin-top: 20px;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8); /* Glowing effect */
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-list {
        flex-direction: column; /* Stack tabs vertically */
        align-items: center; /* Center-align the items */
        gap: 15px; /* Add space between the items */
        padding: 10px 0;
    }

    .nav-item {
        padding: 8px 10px; /* Increase padding for better touch interaction */
        width: 100%; /* Make the tabs stretch across the width */
        text-align: center; /* Center text for vertical layout */
        font-size: 1rem;
    }

    .main-content {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        padding: 10px; /* Reduce padding for compact screens */
        gap: 10px; /* Reduce gap between sections */
    }

    .tab-content {
        padding: 15px; /* Reduce padding for smaller screens */
        border-radius: 8px; /* Slightly smaller rounded corners */
        font-size: 0.9rem; /* Slightly smaller font size */
    }

    .footer {
        font-size: 0.7rem; /* Reduce font size for smaller screens */
        padding: 8px; /* Adjust padding for space efficiency */
    }

    progress {
        width: 100%; /* Full width on smaller screens */
    }

    .stat label {
        font-size: 1rem; /* Adjust font size for compact screens */
    }

    .tooltip {
        font-size: 0.7rem; /* Slightly smaller text for compact view */
        padding: 5px 8px; /* Reduce padding */
        max-width: 180px; /* Constrain width further for smaller screens */
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjust grid for smaller screens */
        gap: 15px;
    }

    .inventory-item {
        padding: 8px;
    }

    .item-icon {
        width: 40px;
        height: 40px;
    }

    /* Side Panel */
    .side-panel {
        width: 250px; /* Narrower side panel */
        padding: 15px;
    }

    .side-panel-header {
        font-size: 1rem; /* Smaller font size for side panel header */
    }

    .item-details-icon {
        width: 80%; /* Reduce image size in side panel */
    }

    /* Footer Navigation */
    .footer-nav {
        flex-direction: column; /* Stack buttons and text */
        gap: 10px;
    }

    .map-container {
        margin: 10px auto;
        max-width: 100%; /* Reduce width for smaller screens */
    }

    .interactive-map {
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); /* Subtle glow for smaller screens */
        border-radius: 5px; /* Reduce rounding for compact design */
    }

    .modal-content {
        width: 90%; /* Reduce modal width */
        padding: 15px; /* Adjust padding */
    }

    .close-button {
        font-size: 1.2rem; /* Reduce close button size */
    }
}

@media (max-width: 480px) {
    /* Navigation */
    .nav-list {
        flex-direction: column; /* Stack navigation items */
        gap: 15px; /* Add more spacing between items */
        align-items: stretch; /* Fill available width */
    }

    .nav-item {
        font-size: 0.9rem; /* Reduce font size for compact view */
        padding: 6px 8px; /* Compact padding */
    }

    /* Header */
    .header {
        padding: 8px 10px; /* Reduce header padding */
    }

    /* Main Content Adjustments */
    .main-content {
        padding: 5px; /* Reduce main content padding */
        gap: 5px; /* Reduce gap between grid items */
    }

    /* Footer */
    .footer {
        font-size: 0.6rem; /* Further reduce font size for footer */
        padding: 6px; /* Minimize padding */
    }

    .tab-content {
        padding: 10px; /* Further reduce padding */
        border-radius: 5px; /* Smaller rounded corners */
        font-size: 0.8rem; /* Smaller font size */
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.3); /* Subtle glow for smaller devices */
    }

    /* Tab Content */
    .tab-content h1 {
        font-size: 1.5rem; /* Scale down headings for compact screens */
    }

    #stats {
        padding: 10px; /* Reduce padding for smaller screens */
        border-radius: 5px; /* Reduce border radius */
    }

    .stat {
        margin: 8px 0; /* Adjust spacing between attributes */
    }

    .stat label {
        font-size: 1rem; /* Reduce font size for smaller screens */
    }

    progress {
        width: 100%; /* Use full width for progress bars */
        height: 15px; /* Reduce height for compact appearance */
    }

    progress::-webkit-progress-bar {
        border: 1px solid #0f0; /* Keep contrast for visibility */
        border-radius: 3px; /* Adjust for smaller bars */
    }

    progress::-webkit-progress-value {
        border-radius: 3px; /* Match smaller bar radius */
        box-shadow: 0 0 3px rgba(0, 255, 0, 0.8); /* Adjust glow for smaller size */
    }

    .tooltip {
        font-size: 0.6rem; /* Further reduce text size */
        padding: 4px 6px; /* Minimal padding for compact view */
        max-width: 160px; /* Constrain width for small screens */
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Narrower items for mobile */
        gap: 10px;
    }

    .inventory-item {
        padding: 5px;
    }

    .item-icon {
        width: 35px;
        height: 35px;
    }


    /* Side Panel */
    .side-panel {
        width: 200px; /* Narrow side panel for mobile */
        padding: 10px;
    }

    .side-panel-header {
        font-size: 0.8rem; /* Smaller header text */
    }

    .item-details-icon {
        width: 100%; /* Full width for smaller images */
    }

    /* Footer Navigation */
    .footer-nav {
        flex-direction: column; /* Stack navigation buttons */
        text-align: center; /* Center-align text */
        gap: 8px; /* Compact spacing */
    }

    .pip-boy-button {
        font-size: 0.8rem; /* Smaller button text */
        padding: 6px 12px; /* Compact padding */
    }

    .map-container {
        margin: 5px auto;
        max-width: 100%; /* Full-width for very small screens */
    }

    .interactive-map {
        border-width: 1px; /* Thinner border */
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.5); /* Subtle glow */
    }

    .modal-content {
        font-size: 0.9rem; /* Smaller text size for modal */
        padding: 10px; /* Compact padding */
    }

    .close-button {
        font-size: 1rem; /* Further reduce close button size */
        top: 5px;
        right: 5px;
    }

    .quest-marker {
        r: 10; /* Reduce marker size */
    }
}


