/* Navy Blue Theme - Zonday Game */

:root {
    --navy-dark: #0a192f;
    --navy: #112240;
    --navy-light: #233554;
    --text-primary: #e6f1ff;
    --text-secondary: #a8b2d1;
    --accent: #64ffda;
    --accent-secondary: #ffd700;
    
    /* Font families */
    --font-display: 'Press Start 2P', cursive;
    --font-heading: 'VT323', monospace;
    --font-mono: 'Share Tech Mono', monospace;
    --font-body: 'Space Mono', monospace;
}

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

body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--navy-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    letter-spacing: 0.03em;
}

.app-container {
    width: 100%;
    max-width: 70%;
    padding: 20px;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .app-container {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .app-container {
        max-width: 95%;
    }
}

h1 {
    font-family: var(--font-display);
    color: var(--accent);
    border-bottom: 1px solid var(--navy-light);
    padding-bottom: 15px;
    padding-top: 10px;
    text-align: center;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.05em;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Decryption effect styles */
.decrypt-effect {
    visibility: hidden; /* Initially hidden, will be shown by JS */
}

.decrypt-char {
    display: inline-block;
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent), 0 0 10px var(--accent);
    animation: decrypt-flicker 0.2s infinite;
    position: relative;
    transform-style: preserve-3d;
    perspective: 500px;
}

.decrypt-char.decrypted {
    animation: decrypt-reveal 0.5s forwards;
    color: var(--accent);
}

@keyframes decrypt-reveal {
    0% {
        text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
        transform: rotateX(10deg);
    }
    100% {
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        transform: rotateX(0);
    }
}

@keyframes decrypt-flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

/* Product container styles */
.product-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    background-color: var(--navy);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.product-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    align-self: flex-start;
}

.product-info {
    flex: 2;
    min-width: 0;
}

.info-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 2px;
    display: block;
}

#product-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0;
    letter-spacing: 0.04em;
}

#product-description {
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (min-width: 1200px) {
    .product-container {
        flex-wrap: nowrap;
    }
    
    .product-image {
        max-width: 40%;
    }
    
    .product-info {
        max-width: 60%;
    }
}

/* Keyframes for the glowing border animation */
@keyframes glowingBorder {
    0% {
        box-shadow: 0 0 5px var(--accent), 0 0 10px var(--accent), 0 0 15px var(--accent);
        border-color: var(--accent);
    }
    50% {
        box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 25px var(--accent);
        border-color: var(--accent-secondary);
    }
    100% {
        box-shadow: 0 0 5px var(--accent), 0 0 10px var(--accent), 0 0 15px var(--accent);
        border-color: var(--accent);
    }
}

/* Keyframes for the rotating glow effect */
@keyframes rotatingGlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Main image container for the rotating glow effect */
.product-image {
    position: relative;
    isolation: isolate;
}

/* Create a pseudo-element for the rotating glow effect */
.product-image::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary), var(--accent), var(--accent-secondary));
    background-size: 300% 300%;
    animation: rotatingGlow 6s linear infinite;
    z-index: -1;
    filter: blur(10px);
    opacity: 0.8;
    transition: all 0.5s ease;
}

/* Enhance the glow effect on hover */
.product-image:hover::before {
    filter: blur(15px);
    opacity: 1;
}

#main-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--accent);
    position: relative;
    z-index: 1;
    background-color: var(--navy);
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    display: block;
    margin: 8px;
    cursor: pointer;
}

#main-image:hover {
    border-color: var(--accent-secondary);
    transform: scale(1.02);
}

/* Thumbnail styles */
.thumbnail-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.thumbnail:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: var(--accent);
    opacity: 1;
}

.thumbnail.hidden-thumbnail {
    opacity: 0.2;
    filter: blur(4px);
    pointer-events: none;
    position: relative;
}

.thumbnail.hidden-thumbnail::after {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

/* Rating styles */
.star-rating {
    color: var(--accent-secondary);
    font-size: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Guess container styles */
.guess-container {
    background-color: var(--navy);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 1px solid var(--navy-light);
    width: 100%;
}

/* Guess header with help button */
.guess-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.guess-header h3 {
    margin: 0;
}

.help-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--navy-light);
    color: var(--accent);
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.help-button:hover {
    background-color: var(--accent);
    color: var(--navy-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Guess instruction spacing */
.guess-instruction {
    margin-bottom: 25px;
    font-family: var(--font-body);
    font-size: 1.05em;
}

/* Guess input row for horizontal layout */
.guess-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.price-input {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    flex-wrap: wrap;
}

.price-input label {
    margin-right: 10px;
    font-weight: bold;
}

.price-input input {
    padding: 12px;
    font-size: 18px;
    font-family: var(--font-mono);
    border: 2px solid var(--navy-light);
    border-radius: 4px;
    width: 120px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    /* Remove spinner buttons for different browsers */
    /* Chrome, Safari, Edge, Opera */
    -webkit-appearance: none;
    /* Standard property */
    appearance: none;
    margin: 0;
    /* Firefox */
    -moz-appearance: textfield;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.price-input input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.2);
}

.price-input .dollar {
    font-family: var(--font-mono);
    font-size: 20px;
    margin-right: 8px;
    color: var(--accent-secondary);
}

/* Button styles */
button {
    background-color: var(--accent);
    color: var(--navy-dark);
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-family: var(--font-mono);
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

button:hover {
    background-color: rgba(100, 255, 218, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

button:disabled {
    background-color: rgba(100, 255, 218, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result modal overlay */
.result-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.result-overlay.visible {
    display: flex;
}

/* Result container styles */
.result-container {
    position: relative;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.result-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: inherit;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    padding: 12px;
}

.result-close-btn:hover {
    opacity: 1;
}

.result-success {
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #98ffc9;
}

.result-close {
    background-color: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffe066;
}

.result-fail {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ffb3b8;
}

.actual-price {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-secondary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.05em;
}

#result-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    letter-spacing: 0.05em;
}

#result-message {
    font-family: var(--font-body);
}

.result-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.result-buttons button {
    flex: 1;
}

/* Difficulty badge styles */
.difficulty-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.difficulty-easy {
    background-color: rgba(40, 167, 69, 0.2);
    color: #98ffc9;
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.difficulty-medium {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffe066;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.difficulty-hard {
    background-color: rgba(220, 53, 69, 0.2);
    color: #ffb3b8;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

/* Loading styles */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(100, 255, 218, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--accent);
    font-size: 18px;
    margin-top: 15px;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* Error styles */
.error {
    color: var(--text-primary);
    background-color: rgba(220, 53, 69, 0.2);
    padding: 40px;
    border-radius: 10px;
    margin: 30px 0;
    text-align: center;
    border: 1px solid rgba(220, 53, 69, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-emoji {
    font-size: 60px;
    margin-bottom: 20px;
    letter-spacing: 10px;
}

.error-message {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    letter-spacing: 0.05em;
}

/* Guesses remaining styles */
#guesses-remaining {
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--accent);
    font-size: 1em;
    padding: 5px 10px;
    background-color: rgba(100, 255, 218, 0.1);
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Guess feedback styles */
/* Inline feedback styles */
.guess-feedback.feedback-much-lower {
    color: #ff6b6b;
    font-weight: bold;
}

.guess-feedback.feedback-lower {
    color: #ffa94d;
    font-weight: bold;
}

.guess-feedback.feedback-higher {
    color: #4dabf7;
    font-weight: bold;
}

.guess-feedback.feedback-much-higher {
    color: #9775fa;
    font-weight: bold;
}

.guess-feedback.feedback-correct {
    color: #51cf66;
    font-weight: bold;
}

/* Guess history styles */
#guess-history {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--navy-light);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

#guess-history.hidden {
    display: none;
}

.guess-history-footer {
    font-family: var(--font-heading);
    color: var(--accent);
    margin-bottom: 0;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
    font-size: 1em;
    letter-spacing: 0.05em;
    text-align: center;
    opacity: 0.7;
}

#guesses-list {
    list-style: none;
    padding: 0;
}

#guesses-list li {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    gap: 15px; /* Add minimum spacing between elements */
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

#guesses-list li:hover {
    background-color: rgba(255,255,255,0.05);
}

#guesses-list li:last-child {
    border-bottom: none;
}

#guesses-list .guess-amount {
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--accent-secondary);
    font-size: 1.1em;
    letter-spacing: 0.05em;
    min-width: 80px; /* Ensure minimum width */
}

#guesses-list .guess-feedback {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    letter-spacing: 0.03em;
    flex: 1; /* Take remaining space */
}

/* Stack product image and info vertically on smaller screens */
@media (max-width: 900px) {
    .product-container {
        flex-direction: column;
    }

    .product-image {
        min-width: unset;
        width: 100%;
    }
}

/* Responsive styles for small screens */
@media (max-width: 768px) {

    h1 {
        font-size: 1.2rem;
    }

    #main-image {
        max-width: 70%;
    }

    .thumbnail-container {
        flex-wrap: wrap;
    }

    .thumbnail {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 0.9rem;
    }

    #main-image {
        max-width: 90%;
    }

    .thumbnail {
        width: 40px;
        height: 40px;
    }

    #guesses-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #guesses-list .guess-amount {
        margin-bottom: 5px;
    }
    
    #guesses-list .guess-feedback {
        width: 100%;
    }
}

/* Footer styles */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    padding-bottom: 30px;
    border-top: 1px solid var(--navy-light);
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 100%;
    font-family: var(--font-body);
    letter-spacing: 0.03em;
}

.admin-links {
    margin-top: 15px;
    font-size: 0.8rem;
}

.admin-links a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.admin-links a:hover {
    background-color: rgba(100, 255, 218, 0.1);
    text-decoration: none;
}

/* Progressive reveal styles */
.info-reveal {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, height 0.5s ease, transform 0.5s ease;
    transform: translateY(-10px);
}

.info-reveal.visible {
    opacity: 1;
    height: auto;
    margin-bottom: 15px;
    transform: translateY(0);
}

#initial-message {
    font-family: var(--font-mono);
    font-style: italic;
    color: var(--text-secondary);
    padding: 15px;
    background-color: var(--navy-light);
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    letter-spacing: 0.03em;
    box-sizing: border-box;
    word-wrap: break-word;
}

.hidden {
    display: none;
}

/* Help modal styles */
.help-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.help-overlay.visible {
    display: flex !important;
}

.help-container {
    position: relative;
    background-color: var(--navy);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--navy-light);
}

.help-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    padding: 12px;
}

.help-close-btn:hover {
    opacity: 1;
    background: none;
    transform: none;
}

.help-container h3 {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
}

.help-description {
    font-family: var(--font-body);
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.accuracy-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-family: var(--font-mono);
}

.accuracy-table thead {
    background-color: var(--navy-light);
}

.accuracy-table th {
    padding: 12px;
    text-align: left;
    color: var(--accent);
    font-weight: bold;
    border-bottom: 2px solid var(--accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9em;
}

.accuracy-table td {
    padding: 12px;
    border-bottom: 1px solid var(--navy-light);
    color: var(--text-primary);
}

.accuracy-table tbody tr:hover {
    background-color: rgba(100, 255, 218, 0.05);
}

.accuracy-table tbody tr:last-child td {
    border-bottom: none;
}

.emoji-cell {
    font-size: 1.3em;
    text-align: center;
}

.help-note {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background-color: var(--navy-light);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}
