/* style.css - Retro-Cyberpunk ASCII Art Converter Design */

:root {
    --bg-primary: #0a0b10;
    --bg-card: rgba(20, 22, 37, 0.6);
    --bg-input: rgba(30, 33, 58, 0.8);
    --accent-cyan: #00f0ff;
    --accent-magenta: #ff007f;
    --accent-green: #39ff14;
    --accent-amber: #ffb000;
    --text-primary: #f0f4f8;
    --text-secondary: #8c9ba5;
    --text-muted: #52606d;
    --border-color: rgba(0, 240, 255, 0.2);
    --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.4);
    --glow-magenta: 0 0 15px rgba(ff, 0, 127, 0.4);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Share Tech Mono', 'Courier New', Courier, monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 0, 127, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 40%);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 8px var(--accent-cyan));
    animation: pulse 2s infinite alternate;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.2));
}

.version-tag {
    font-family: var(--font-mono);
    color: var(--accent-magenta);
    font-size: 0.8rem;
    border: 1px solid var(--accent-magenta);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-shadow: 0 0 5px var(--accent-magenta);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-links a:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.1), var(--glow-cyan);
}

/* Main Container */
.app-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 73px);
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }
}

/* Sidebar Controls */
.controls-sidebar {
    background: rgba(15, 17, 30, 0.9);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.control-group {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.3s ease;
}

.control-group:hover {
    border-color: rgba(0, 240, 255, 0.3);
}

.control-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.control-value {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

/* Input Customization */
select, input[type="text"] {
    background: var(--bg-input);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus, input[type="text"]:focus {
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

/* Slider Customization */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: var(--glow-cyan);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(0, 240, 255, 0.2);
    border-color: var(--accent-cyan);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

/* Drag and Drop Zone */
.dropzone {
    border: 2px dashed rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.03);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.1);
}

.dropzone-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

.dropzone text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Action Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #0077ff);
    color: #fff;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

/* Viewport Area */
.viewport-container {
    background: #050608;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
    position: relative;
}

.screen-wrapper {
    flex: 1;
    background: #020204;
    border: 2px solid #1a1c2d;
    border-radius: 16px;
    position: relative;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 10px 30px rgba(0,0,0,0.5);
    min-height: 400px;
}

/* CRT Screen Scanline Overlay Effect */
.screen-wrapper::after {
    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));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.5;
}

.ascii-output {
    font-family: var(--font-mono);
    font-size: 8px; /* Dynamic size changed via JS */
    line-height: 1.0;
    letter-spacing: 0.05em;
    white-space: pre;
    color: var(--accent-green);
    text-shadow: 0 0 2px rgba(57, 255, 20, 0.5);
    margin: auto;
    padding: 1.5rem;
    user-select: all;
    transition: font-size 0.2s ease;
}

/* Specific styling for colored output */
.ascii-output span {
    display: inline-block;
}

/* Empty State / Welcome Screen */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
    padding: 3rem;
    max-width: 450px;
    z-index: 1;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.4));
    animation: float 4s ease-in-out infinite;
}

.empty-state h2 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; filter: drop-shadow(0 0 12px var(--accent-cyan)); }
}

/* Utility bar on top of Viewport */
.viewport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewport-title {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.status-indicator.processing {
    background-color: var(--accent-magenta);
    box-shadow: 0 0 8px var(--accent-magenta);
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.action-bar {
    display: flex;
    gap: 0.75rem;
}

/* Spinner Loader */
.spinner {
    border: 3px solid rgba(0, 240, 255, 0.1);
    border-top: 3px solid var(--accent-cyan);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    filter: drop-shadow(0 0 5px var(--accent-cyan));
}

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

.hidden {
    display: none !important;
}

/* Toast Message Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 17, 30, 0.9);
    border: 1px solid var(--accent-cyan);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    box-shadow: var(--glow-cyan), 0 10px 25px rgba(0,0,0,0.5);
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.toast.show {
    transform: translateY(0);
}

/* Hidden canvas for image operations */
#hidden-canvas {
    display: none;
}
