:root {
    --primary-color: #ff00ff; /* Neon Pink/Magenta */
    --secondary-color: #00ffff; /* Neon Cyan */
    --accent-color: #ffff00; /* Neon Yellow */
    --dark-color: #0d0221; /* Deep Purple/Blue */
    --light-color: #f0f0f0;
    --smash-color: #39ff14; /* Neon Green */
    --pass-color: #ff073a; /* Neon Red */
    --neutral-color: #feca57;
    --bg-color: #0d0221;
    --text-color: #f0f0f0;
    --container-bg: rgba(26, 1, 51, 0.85); /* Darker purple, semi-transparent */
    --border-color: var(--secondary-color);
    --font-heading: 'Press Start 2P', cursive;
    --font-body: 'VT323', monospace;
    --subtitle-color: #b0bec5;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--dark-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    background-image: 
        linear-gradient(rgba(13, 2, 33, 0.95), rgba(13, 2, 33, 0.95)),
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    animation: moveGrid 10s linear infinite;
    background-attachment: fixed;
}

@keyframes moveGrid {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, -40px -40px, -40px -40px; }
}

.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0) 2px,
        rgba(255, 255, 255, 0.05) 3px,
        rgba(255, 255, 255, 0.05) 4px
    );
    pointer-events: none;
    z-index: 9999;
    animation: scanlines 10s linear infinite;
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--container-bg);
    border-radius: 0;
    box-shadow: 0 0 15px var(--primary-color), inset 0 0 10px var(--primary-color);
    padding: 30px 40px;
    overflow: hidden;
    backdrop-filter: blur(5px);
    border: 2px solid var(--primary-color);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    font-size: 1.8rem;
    font-weight: normal;
    margin-bottom: 15px;
    text-shadow: 
        0 0 5px var(--secondary-color),
        0 0 10px var(--secondary-color),
        -2px 2px 0px var(--primary-color);
    letter-spacing: 2px;
}

.subtitle {
    font-family: var(--font-body);
    color: var(--light-color);
    font-size: 1.5rem;
    font-weight: normal;
}

.disclaimer {
    background-color: rgba(254, 202, 87, 0.1);
    border-left: 5px solid var(--neutral-color);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 0;
    position: relative;
    font-size: 1.2rem;
}

.disclaimer p {
    font-size: 1.3rem;
    line-height: 1.6;
}

.disclaimer strong {
    color: #ff5252;
    font-weight: normal;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--light-color);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    font-family: var(--font-body);
}

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

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0;
    padding: 50px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    margin-bottom: 30px;
    background-color: rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(255, 0, 255, 0.1);
    box-shadow: inset 0 0 10px var(--primary-color);
    transform: none;
}

.upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    color: var(--border-color);
    width: 64px;
    height: 64px;
    transition: all 0.3s;
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

.upload-btn {
    color: var(--primary-color);
    font-weight: normal;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid var(--primary-color);
}

.preview-container {
    margin-top: 30px;
    width: 100%;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.result-container {
    margin-top: 30px;
    width: 100%;
}

.image-preview-container {
    max-height: 350px;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

#image-preview {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
}

#preview-image {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
    font-family: var(--font-body);
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.loading p::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.spinner {
    display: none;
}

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

.result {
    text-align: center;
    padding: 30px;
    border-radius: 0;
    margin-top: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease-in-out;
}

.verdict-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

#verdict {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 1px;
}

#verdict-icon {
    font-size: 2rem;
    line-height: 1;
}

#explanation {
    font-size: 1.6rem;
    line-height: 1.5;
    margin-bottom: 30px;
    color: var(--text-color);
    white-space: pre-wrap;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn {
    font-family: var(--font-body);
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    padding: 12px 24px;
    border-radius: 0;
    font-size: 1.5rem;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: inset 0 0 5px rgba(0, 255, 255, 0.5);
    line-height: 1.2;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: var(--dark-color);
    box-shadow: 0 0 15px var(--secondary-color);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-secondary {
    border-color: #7f8c8d;
    color: #7f8c8d;
    box-shadow: inset 0 0 5px rgba(127, 140, 141, 0.5);
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    color: var(--dark-color);
    box-shadow: 0 0 15px #7f8c8d;
    transform: translateY(-2px);
}

.hidden {
    display: none;
}

/* Smash and Pass specific styles */
.smash {
    background-color: rgba(57, 255, 20, 0.1);
    border-color: var(--smash-color);
    box-shadow: 0 0 10px var(--smash-color);
}

.pass {
    background-color: rgba(255, 7, 58, 0.1);
    border-color: var(--pass-color);
    box-shadow: 0 0 10px var(--pass-color);
}

.ai-type-selector {
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0;
    border: 2px solid var(--border-color);
}

.ai-type-selector p {
    margin-bottom: 15px;
    font-weight: normal;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.ai-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.ai-type-option {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: transparent;
}

.ai-type-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 0, 255, 0.1);
    transform: none;
    box-shadow: none;
}

.ai-type-option input {
    position: absolute;
    opacity: 0;
}

.ai-type-option input:checked + .ai-type-name {
    color: var(--primary-color);
}

.ai-type-option input:checked ~ * {
    font-weight: normal;
}

.ai-type-option input:checked + .ai-type-name::before {
    content: ">> ";
    font-weight: normal;
    color: var(--accent-color);
}

.ai-type-name {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 5px;
}

.ai-type-desc {
    font-size: 1.2rem;
    color: var(--subtitle-color);
}

/* Dark mode styles */
.dark-mode {
    /* Styles removed as dark mode is now the default */
}

.image-preview-container-result {
    position: relative;
    max-height: 350px;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.image-preview-container-result .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: normal;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allows clicks to pass through to the container */
}

.image-preview-container-result:hover .image-overlay {
    opacity: 1;
}

.image-preview-container-result.drag-over {
    border: 2px dashed var(--primary-color);
}

.image-preview-container-result.drag-over .image-overlay {
    opacity: 1;
    background-color: rgba(255, 0, 255, 0.5);
}

/* Theme toggle */
.theme-toggle {
    display: none;
}

/* Add these new styles at the end */
.saved-results {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0;
    border: 2px solid var(--border-color);
}

.saved-results h2 {
    margin-bottom: 20px;
    text-align: center;
    font-weight: normal;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-shadow: 0 0 5px var(--primary-color);
}

.saved-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.saved-result-card {
    background: var(--container-bg);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.saved-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 10px var(--accent-color);
    border-color: var(--accent-color);
}

.saved-result-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.saved-result-info {
    padding: 15px;
}

.saved-result-info .verdict {
    font-weight: normal;
    margin-bottom: 5px;
    color: var(--light-color);
    font-family: var(--font-heading);
    font-size: 1rem;
}

.saved-result-info .explanation {
    max-height: 80px;
    overflow-y: auto;
    padding-right: 5px;
    margin: 8px 0;
    line-height: 1.4;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.saved-result-info .date {
    font-size: 1rem;
    color: var(--subtitle-color);
    margin: 8px 0;
    font-weight: normal;
}

.saved-result-info .ai-type {
    font-style: normal;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--secondary-color);
}

.saved-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.delete-btn, .view-btn {
    padding: 8px 10px;
    border-radius: 0;
    font-size: 1.2rem;
    font-weight: normal;
    width: 100%;
    border: 1px solid;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    text-transform: uppercase;
}

.delete-btn {
    background: transparent;
    border-color: var(--pass-color);
    color: var(--pass-color);
}

.view-btn {
  background: transparent;
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.delete-btn:hover {
    background: var(--pass-color);
    color: var(--dark-color);
    transform: scale(1.05);
}

.view-btn:hover{
    background: var(--accent-color);
    color: var(--dark-color);
    transform: scale(1.05);
}

.save-btn {
    border-color: var(--smash-color);
    color: var(--smash-color);
}

.save-btn:disabled {
    border-color: #555;
    color: #555;
    background: transparent;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.save-btn:disabled:hover {
    background-color: transparent;
}

.save-btn:hover {
    background-color: var(--smash-color);
    color: var(--dark-color);
    box-shadow: 0 0 15px var(--smash-color);
}

.share-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.share-btn:hover {
    background-color: var(--primary-color);
    color: var(--dark-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.view-saved-btn {
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 1px;
    background-color: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
    display: block;
    margin: 30px auto 0;
}

.view-saved-btn:hover {
    background-color: var(--accent-color);
    color: var(--dark-color);
    box-shadow: 0 0 15px var(--accent-color);
}

#popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(13, 2, 33, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

#popup-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.popup-card {
    background-color: var(--container-bg);
    color: var(--text-color);
    border-radius: 0;
    padding: 24px 30px;
    max-width: 550px;
    width: 100%;
    box-shadow: 0 0 20px var(--secondary-color), inset 0 0 15px var(--secondary-color);
    position: relative;
    text-align: center;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 2px solid var(--secondary-color);
}

#popup-overlay.visible .popup-card {
    transform: scale(1);
    opacity: 1;
}

.popup-card img {
    width: 100%;
    max-height: 40vh;
    object-fit: contain;
    border-radius: 0;
    margin-bottom: 20px;
    background-color: #000;
    border: 1px solid var(--border-color);
}

.popup-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

.popup-card p {
    margin: 10px 0;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
}

.popup-card .close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    border: 1px solid var(--subtitle-color);
    color: var(--subtitle-color);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.popup-card .close-popup:hover {
    background: var(--primary-color);
    color: var(--dark-color);
    border-color: var(--primary-color);
    transform: rotate(90deg);
}

.saved-result-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.saved-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.7);
    border-color: var(--accent-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .upload-area {
        padding: 30px 20px;
        font-size: 1.2rem;
    }
    
    .theme-toggle {
        display: none;
    }

    #verdict {
        font-size: 1.2rem;
    }
    .result-actions {
        flex-direction: column;
    }
    
    .btn {
        font-size: 1.2rem;
        padding: 10px 20px;
    }
    
    .ai-type-options {
        grid-template-columns: 1fr;
    }
}