/* ================================
   HACKER THEME - Steam Avatar Downloader
   Matrix/Cyberpunk inspired design
   ================================ */

/* Import monospace font for terminal aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700&display=swap');

/* CSS Variables for easy theming */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0d1117;
    --bg-card: rgba(13, 17, 23, 0.9);
    --accent-primary: #00ff41;
    --accent-secondary: #00cc33;
    --accent-dim: #00802b;
    --text-primary: #00ff41;
    --text-secondary: #00cc33;
    --text-muted: #00802b;
    --error-color: #ff3333;
    --border-glow: 0 0 10px rgba(0, 255, 65, 0.5);
    --text-glow: 0 0 10px rgba(0, 255, 65, 0.8);
    --font-mono: 'Share Tech Mono', 'Courier New', monospace;
    --font-display: 'Orbitron', sans-serif;
}

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* Body with animated matrix background */
body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated matrix rain background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg,
            transparent 0%,
            rgba(0, 255, 65, 0.03) 50%,
            transparent 100%
        );
    background-size: 100% 8px;
    animation: scanlines 0.1s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Grid pattern overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

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

/* Main container */
.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
    box-shadow:
        var(--border-glow),
        inset 0 0 30px rgba(0, 255, 65, 0.05);
    backdrop-filter: blur(10px);
}

/* Terminal-style header */
.header {
    margin-bottom: 30px;
    text-align: center;
}

.header::before {
    content: '> ';
    color: var(--accent-secondary);
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-shadow: var(--text-glow);
    display: inline;
    animation: flicker 4s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 1px;
}

.subtitle::before {
    content: '// ';
}

/* Form styling */
.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper::before {
    content: '$';
    position: absolute;
    left: 15px;
    color: var(--accent-secondary);
    font-size: 1rem;
    z-index: 1;
}

input[type="text"] {
    width: 100%;
    padding: 15px 15px 15px 35px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

input[type="text"]:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--border-glow);
    background: rgba(0, 0, 0, 0.8);
}

/* Blinking cursor effect on focus */
input[type="text"]:focus::placeholder {
    animation: blink 1s step-end infinite;
}

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

/* Button styling */
button {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 15px 30px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-radius: 4px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 255, 65, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

button:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: var(--border-glow);
    text-shadow: var(--text-glow);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    width: 100%;
    margin-top: 15px;
}

.btn-download {
    margin-top: 20px;
    background: rgba(0, 255, 65, 0.1);
}

.btn-download::after {
    content: ' [DOWNLOAD]';
    opacity: 0.7;
}

/* Error message styling */
.error {
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    color: var(--error-color);
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
    animation: errorPulse 2s ease-in-out infinite;
}

.error::before {
    content: '[ERROR] ';
    font-weight: bold;
}

@keyframes errorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Avatar result section */
.result {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--accent-dim);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.result h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.result h2::before {
    content: '[ ';
    color: var(--accent-dim);
}

.result h2::after {
    content: ' ]';
    color: var(--accent-dim);
}

/* Avatar image styling */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

.avatar-wrapper::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--accent-primary);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px var(--accent-primary);
        opacity: 0.8;
    }
}

.avatar-img {
    width: 184px;
    height: 184px;
    border-radius: 6px;
    display: block;
    filter: saturate(1.1);
    transition: all 0.3s ease;
}

.avatar-img:hover {
    filter: saturate(1.3) brightness(1.1);
    transform: scale(1.02);
}

/* Status indicator */
.status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 15px;
}

.status::before {
    content: '> STATUS: ';
    color: var(--accent-secondary);
}

/* Footer */
.footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--accent-dim);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-dim);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }

    body {
        padding: 15px;
    }

    .container {
        padding: 25px 20px;
    }

    h1 {
        letter-spacing: 1px;
    }

    input[type="text"] {
        padding: 12px 12px 12px 30px;
    }

    button {
        padding: 12px 20px;
        letter-spacing: 1px;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 20px 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    h1 {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .avatar-img {
        width: 150px;
        height: 150px;
    }

    button {
        width: 100%;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --accent-primary: #00ff00;
        --bg-card: #000000;
    }

    body::before,
    body::after {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    body::before,
    body::after {
        display: none;
    }

    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
