/* Base styling */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: calc(12px + 0.5vw); /* Responsive font size */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    background-color: #f5f5f5;
}

/* Main container setup */
.main-container {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh; /* Full viewport height */
    width: 100%; /* Full viewport width */
    overflow-y: auto; /* Allow vertical scrolling on smaller screens */
    overflow-x: hidden; /* Avoid horizontal scrolling */
}

/* Left panel (background) setup */
.left-panel {
    position: fixed; /* Change to fixed to ensure it stays in the background */
    top: 0;
    left: 0;
    z-index: -1; /* Place it behind the content */
    width: 100%;
    height: 100vh; /* Ensure it covers the entire viewport */
    overflow: hidden;
}

.left-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image covers the container without distortion */
}

/* Game content container (to place your game content on top of the background) */
.game-content-container {
    position: relative; /* Keep this on top of the left-panel */
    z-index: 1; /* Ensure the content appears above the background */
    padding: 10px; /* Reduce padding between the container and its contents */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px; /* Optional: Reduce the gap between child elements */
}

/* Logo section at the top */
.logos-container {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 2;
}

.logo-neah {
    height: 22px;
    width: auto;
}

.logo-game {
    height: 30px;
    width: auto;
}

/* Main content (right panel) */
.right-panel-content {
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent layer */
    padding: 20px;
    border-radius: 10px;
    margin: 0 10px;
    text-align: center;
    width: 95%;
    box-sizing: border-box; /* Account for padding and margin */
    max-width: 95%;
    position: relative;
    margin-top: 60px; /* Ensure space below logos */
    margin-bottom: 40px; /* Space for the footer */
    z-index: 2;
    color: white;
    overflow-y: auto; /* Allow scrolling for large content */
    flex-grow: 1;
}

/* Score and footer adjustments */
.scores-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.progress-bar-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    margin: 10px 0;
}

.progress-bar-label {
    font-size: 14px;
    font-weight: bold;
    width: 30%;
    color: #fff;
}

.progress-bar {
    width: 70%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 10px;
    position: absolute;
}

.sustainability-bar .progress {
    background-color: #4caf50;
}

.security-bar .progress {
    background-color: #1e88e5;
}

.equity-bar .progress {
    background-color: #ffb300;
}

.progress-bar span {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    line-height: 20px;
    font-size: 14px;
    font-weight: bold;
    color: black;
}

/* Footer with restart button */
footer {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    z-index: 2;
    position: relative;
    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    flex-shrink: 0;
    padding: 10px 0;        
}

.restart-button {
    margin-top: 10px;
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    width: 95%;
    text-align: center;
}

.restart-button:hover {
    background-color: #388E3C;
}

button {
    margin-bottom: 10px; /* Adds spacing between buttons */
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    width: 30%;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #388E3C;
}

.score-delta {
    font-weight: bold;
    font-size: 14px;
    min-width: 50px;
    text-align: left;
    padding-left: 10px;
}

.score-delta.positive {
    color: green;
}

.score-delta.negative {
    color: red;
}

/* Fixes specifically for the history page on mobile */

.history-page .right-panel-content {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin: 60px 10px 40px 10px;       /* ← Match your global .right-panel-content */
    text-align: center;
    width: 95%;                        /* ← Match your global setup */
    max-width: 95%;
    box-sizing: border-box;
    color: white;
    overflow-y: auto;
    flex-grow: 1;
}

.history-page .main-container {
    width: 100%;
    height: 100vh;
    overflow-x: hidden;                  /* Prevent horizontal scroll */
    overflow-y: auto;                    /* Allow vertical scroll */
    display: flex;
    flex-direction: column;
}

.history-page .game-content-container {
    flex-grow: 1;
    overflow-y: auto;                    /* Let content scroll */
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* Keep the existing log card styles, but prevent overflow */
.history-page .history-scroll {
    max-height: none;                    /* Remove fixed height */
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 20px;
}

.history-page .history-scroll .log-card {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    overflow-wrap: break-word;           /* Break long words if needed */
}

.history-page .history-scroll .log-card p,
.history-page .history-scroll .log-card h3,
.history-page .history-scroll .log-card .timestamp {
    color: white;
}

.history-page .right-panel-content h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    margin-top: 0;
}

.history-page .ok-button {
    width: 30%;
    min-width: 100px;
    margin: 10px auto;
}

.small-button {
    font-size: 0.9rem;
    padding: 8px 16px;
    margin: 4px 0;
    display: inline-block;
    text-align: center;
}
.review-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.review-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.review-buttons a.ok-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    text-decoration: none;
    padding: 10px 16px;
    font-size: 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 90%;
    text-align: center;
}

.review-buttons a.ok-button:hover {
    background-color: #388E3C;
}

.review-buttons a.ok-button.small-button {
    font-size: 0.85rem;
    padding: 8px 12px;
    width: auto;
    min-width: 150px;
    max-width: 90%;
}