/* 80s Hacker Dark Mode Theme */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    background-color: #0d0208;
    color: #00ff41;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    text-shadow: 0 0 1px #00ff41;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* CRT Scanlines Effect */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    /* animation: flicker 0.15s infinite; */ /* Flashing effect removed */
}

/* @keyframes flicker {
    0% { opacity: 0.2; }
    20% { opacity: 0.8; }
    40% { opacity: 0.3; }
    60% { opacity: 0.9; }
    80% { opacity: 0.4; }
    100% { opacity: 1; }
} */

/* Container */
.container {
    background: rgba(0, 20, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 0;
    padding: 30px;
    box-shadow: 0 0 10px #00ff41;
    max-width: 800px;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-out;
}

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

/* Typography */
/* User Header */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.logout-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
}

h1 {
    text-align: left;
    color: #00ff41;
    margin: 0;
    font-size: 3em;
    text-transform: uppercase;
}

h2 {
    color: #00ff41;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.8em;
}

/* Canvas Container */
.canvas-container {
    border: 2px solid #00ff41;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
    margin: 0 auto;
    width: fit-content;
}

#drawingCanvas {
    display: block;
    cursor: crosshair;
    background: #000;
}

/* Brush Controls */
.brush-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
    color: #00ff41;
}

.brush-size-container label,
.color-picker-container label {
    font-weight: normal;
    font-size: 1.2em;
}

#brushSize {
    width: 150px;
}

#brushSizeValue {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

#colorPicker {
    width: 50px;
    height: 40px;
    border: 2px solid #00ff41;
    border-radius: 0;
    cursor: pointer;
    background-color: #0d0208;
}

/* Buttons */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    font-size: 1.2em;
    border: 2px solid #00ff41;
    border-radius: 0;
    cursor: pointer;
    font-family: 'VT323', monospace;
    background: transparent;
    color: #00ff41;
    text-transform: uppercase;
    transition: background 0.3s, color 0.3s;
}

.btn:hover, .btn:focus {
    background: #00ff41;
    color: #0d0208;
    box-shadow: 0 0 8px #00ff41;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    color: #00ff41;
}

/* Loading State */
.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid rgba(0, 255, 65, 0.3);
    border-top: 4px solid #00ff41;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.2em;
}

/* Error Message */
.error-message {
    color: #ff0000;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    display: none;
}

.error-message.active {
    display: block;
}

/* Result Container */
.result-container {
    margin-top: 30px;
    text-align: center;
    display: none;
}

.result-container.active {
    display: block;
}

#resultImage {
    max-width: 100%;
    max-height: 400px;
    border: 2px solid #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
    margin: 20px auto;
    display: block;
    background-image:
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

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

/* Monster Name Styles */
.monster-name {
    text-align: center;
    margin: 15px 0;
}

.monster-name h3 {
    color: #00ff41;
    font-size: 1.8em;
    margin: 0;
    text-transform: capitalize;
    text-shadow: 0 0 3px #00ff41;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #00ff41;
    padding: 10px 20px;
    display: inline-block;
}

/* Monster Info Styles */
.monster-info {
    margin: 20px 0;
    text-align: left;
    max-width: 600px;
    margin: 20px auto;
}

.monster-type h3 {
    text-align: center;
    color: #00ff41;
    margin-bottom: 15px;
    font-size: 1.4em;
    text-transform: capitalize;
}

/* AI Analysis Styles */
.monster-analysis {
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #00ff41;
    padding: 15px;
    margin-bottom: 15px;
}

.monster-analysis h4 {
    color: #00ff41;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.characteristics ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.characteristics li {
    color: #cccccc;
    padding: 3px 0;
    border-left: 3px solid #00ff41;
    padding-left: 10px;
    margin-bottom: 5px;
    background: rgba(0, 0, 0, 0.2);
}

.personality p, .stats-profile p {
    color: #cccccc;
    font-style: italic;
    margin: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid #00ff41;
}

.stats-profile p {
    text-transform: capitalize;
    font-weight: bold;
    color: #ffff99;
}

.stats-container, .moves-container {
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #00ff41;
    padding: 15px;
    margin-bottom: 15px;
}

.stats-container h3, .moves-container h3 {
    text-align: center;
    color: #00ff41;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 65, 0.3);
}

.stat.total {
    grid-column: 1 / -1;
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    font-weight: bold;
}

.stat-name {
    color: #00ff41;
}

.stat-value {
    color: #ffffff;
    font-weight: bold;
}

/* Moves Styles */
.moves-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.move-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 65, 0.5);
    padding: 10px;
}

.move-item.regular {
    border-left: 4px solid #ffff00;
}

.move-item.special {
    border-left: 4px solid #ff00ff;
}

.move-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.move-name {
    color: #00ff41;
    font-weight: bold;
    font-size: 1.1em;
}

.move-damage {
    color: #ff6666;
    font-weight: bold;
}

.move-description {
    color: #cccccc;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.move-effect {
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid rgba(255, 255, 0, 0.3);
    border-radius: 3px;
    padding: 8px;
    margin: 8px 0;
    font-size: 0.9em;
}

.effect-name {
    color: #ffff99;
    text-transform: capitalize;
}

.effect-detail {
    color: #cccccc;
}

.effect-chance {
    color: #ff9999;
    font-style: italic;
}

.effect-description {
    color: #aaaaaa;
    font-style: italic;
}

.move-details {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
}

.move-detail {
    color: #999999;
}

.move-detail strong {
    color: #00ff41;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .user-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    h1 { 
        font-size: 2em; 
        text-align: center;
    }
    .container { 
        padding: 15px; 
        margin-top: 10px;
        margin-bottom: 20px;
    }
    #drawingCanvas { width: 100%; height: auto; }
    .btn { padding: 8px 15px; font-size: 1em; }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat {
        padding: 4px 8px;
        font-size: 0.9em;
    }
    
    .move-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .move-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .monster-info {
        margin: 15px auto;
    }
    
    .move-effect {
        font-size: 0.8em;
        padding: 6px;
    }
    
    .move-details {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #00ff41;
    height: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #00ff41;
    height: 20px;
    width: 10px;
    border: 2px solid #0d0208;
    box-shadow: 0 0 5px #00ff41;
}

input[type="range"]::-moz-range-track {
    background: #00ff41;
    height: 2px;
}

input[type="range"]::-moz-range-thumb {
    background: #00ff41;
    height: 20px;
    width: 10px;
    border: 2px solid #0d0208;
    border-radius: 0;
}
