/* ==========================================
   1337 THEME - CORE VARIABLES
   ========================================== */
:root {
    --bg-primary: #050505;
    --bg-secondary: #0a0f0a;
    --bg-card: #000000;

    --text-primary: #00ff41;
    /* Matrix Green */
    --text-secondary: #008F11;
    /* Darker Green */
    --text-muted: #003b00;

    --accent-primary: #00ff41;
    --accent-secondary: #003b00;
    --accent-hover: #00cc33;

    --border-color: #003b00;

    --success-bg: #001100;
    --success-border: #00ff41;
    --success-text: #00ff41;

    --error-bg: #110000;
    --error-border: #ff0000;
    --error-text: #ff0000;

    --warning-bg: #111100;
    --warning-border: #ffff00;
    --warning-text: #ffff00;

    --shadow-glow: 0 0 10px rgba(0, 255, 65, 0.5);
    --shadow-card: 0 0 20px rgba(0, 255, 65, 0.1);

    --font-main: 'Share Tech Mono', monospace;
    --font-display: 'VT323', monospace;
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Scanline Effect Overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    animation: scrollScanlines 10s linear infinite;
}

@keyframes scrollScanlines {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    animation: widthPulse 4s infinite;
}

@keyframes widthPulse {

    0%,
    100% {
        width: 100%;
        opacity: 1;
    }

    50% {
        width: 90%;
        opacity: 0.5;
    }
}

h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 10px var(--accent-primary);
    position: relative;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 90px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    60% {
        clip: rect(40px, 9999px, 20px, 0);
    }

    80% {
        clip: rect(70px, 9999px, 60px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 80px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    20% {
        clip: rect(50px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    60% {
        clip: rect(20px, 9999px, 40px, 0);
    }

    80% {
        clip: rect(60px, 9999px, 70px, 0);
    }

    100% {
        clip: rect(30px, 9999px, 50px, 0);
    }
}

main {
    flex: 1;
}

/* ==========================================
   CARDS & CONTAINERS
   ========================================== */
.card,
.info-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: var(--shadow-card);
}

.card::before,
.info-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent-primary);
    border-left: 2px solid var(--accent-primary);
}

.card::after,
.info-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--accent-primary);
    border-right: 2px solid var(--accent-primary);
}

.info-card {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
}

.info-card h3 {
    color: var(--accent-primary);
    text-transform: uppercase;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.info-card li::before {
    content: '> ';
    color: var(--accent-primary);
}

/* ==========================================
   INPUTS
   ========================================== */
.input-section h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.size-input,
.unit-select,
.filename-input {
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    padding: 1rem;
    font-family: var(--font-main);
    font-size: 1.2rem;
    border-radius: 0;
    box-shadow: inset 0 0 10px rgba(0, 59, 0, 0.5);
}

.size-input:focus,
.unit-select:focus,
.filename-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.filename-group {
    margin-bottom: 2rem;
}

.filename-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* ==========================================
   BUTTONS
   ========================================== */
.preset-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.preset-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.8rem;
    font-family: var(--font-main);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.preset-btn:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 15px var(--accent-primary);
}

.generate-btn {
    width: 100%;
    padding: 1.5rem;
    background: var(--accent-primary);
    color: #000;
    border: none;
    font-family: var(--font-display);
    font-size: 2rem;
    text-transform: uppercase;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s;
    letter-spacing: 2px;
    font-weight: bold;
}

.generate-btn:hover {
    background: #fff;
    box-shadow: 0 0 30px var(--accent-primary);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.generate-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   PROGRESS & STATUS
   ========================================== */
.progress-bar-container {
    background: #001100;
    border: 1px solid var(--accent-primary);
    height: 20px;
    border-radius: 0;
    padding: 2px;
}

.progress-bar {
    background: var(--accent-primary);
    height: 100%;
    width: 0%;
    box-shadow: 0 0 10px var(--accent-primary);
    position: relative;
}

/* Striped animation for progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg,
            rgba(0, 0, 0, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 20px;
    }
}

/* ==========================================
   SUCCESS & ERROR
   ========================================== */
.success-section {
    border: 1px solid var(--success-border);
    background: rgba(0, 20, 0, 0.9);
    padding: 2rem;
}

.success-header h3 {
    color: var(--success-text);
    font-family: var(--font-display);
    font-size: 2rem;
    text-transform: uppercase;
}

.hash-value code {
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    font-family: var(--font-main);
    padding: 0.5rem;
    display: block;
    margin-top: 0.5rem;
    flex: 1;
}

.hash-value {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    margin-bottom: 1px;
    /* Align with code block border */
    text-transform: uppercase;
}

.copy-btn:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 10px var(--accent-primary);
}

.copy-btn.copied {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
}

.download-btn {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    width: 100%;
    padding: 1rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 20px var(--accent-primary);
}

.reset-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    margin-top: 1rem;
    cursor: pointer;
    font-family: var(--font-main);
    text-transform: uppercase;
}

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

/* ==========================================
   FOOTER
   ========================================== */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}