@font-face {
    font-family: 'unscii';
    src: url('unscii-16.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: 'unscii', 'Courier New', monospace;
    line-height: 1.6;
    color: #00ff00;
    background: #000000;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, rgba(0, 255, 0, 0.03) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 98px,
            rgba(0, 255, 0, 0.03) 100px
        );
    z-index: -1;
    animation: matrix-bg 20s linear infinite;
}

@keyframes matrix-bg {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: #00ff00;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 
        0 0 5px #00ff00,
        0 0 10px #00ff00,
        0 0 15px #00ff00,
        0 0 20px #00ff00;
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
    text-shadow: 0 0 5px #00ff00;
}

@keyframes glow-pulse {
    from {
        text-shadow: 
            0 0 5px #00ff00,
            0 0 10px #00ff00,
            0 0 15px #00ff00,
            0 0 20px #00ff00;
    }
    to {
        text-shadow: 
            0 0 2px #00ff00,
            0 0 5px #00ff00,
            0 0 8px #00ff00,
            0 0 12px #00ff00;
    }
}

main {
    flex: 1;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 8px;
    box-shadow: 
        0 0 10px rgba(0, 255, 0, 0.3),
        inset 0 0 10px rgba(0, 255, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(2px);
}

.download-form {
    padding: 30px;
}

.form-section h2 {
    color: #00ff00;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 10px;
    text-shadow: 0 0 5px #00ff00;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #00ff00;
    text-shadow: 0 0 3px #00ff00;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #00ff00;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'unscii', 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 
        0 0 5px #00ff00,
        inset 0 0 5px rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 3px #00ff00;
}

.form-group input::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: rgba(0, 255, 0, 0.7);
    font-size: 0.875rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 255, 0, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ff00;
    cursor: pointer;
    box-shadow: 0 0 5px #00ff00;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ff00;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px #00ff00;
}

.slider-value {
    background: #00ff00;
    color: #000000;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    text-shadow: none;
    box-shadow: 0 0 5px #00ff00;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid #00ff00;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'unscii', 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 0 5px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #00ff00;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 
        0 0 10px #00ff00,
        inset 0 0 10px rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 5px #00ff00;
    transform: translateY(-1px);
}

.btn-success {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    color: #00ff00;
}

.btn-success:hover {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 
        0 0 15px #00ff00,
        inset 0 0 15px rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 5px #00ff00;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.8);
    color: rgba(0, 255, 0, 0.7);
    border: 1px solid rgba(0, 255, 0, 0.5);
}

.btn-secondary:hover {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    border-color: #00ff00;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.progress-section,
.download-section,
.error-section {
    padding: 30px;
    text-align: center;
}

.progress-section h2,
.download-section h2,
.error-section h2 {
    color: #00ff00;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 0 0 5px #00ff00;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00 0%, #00cc00 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px #00ff00;
    animation: progress-glow 2s ease-in-out infinite alternate;
}

@keyframes progress-glow {
    from { box-shadow: 0 0 5px #00ff00; }
    to { box-shadow: 0 0 15px #00ff00; }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: #00ff00;
}

.progress-details {
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #00ff00;
    text-align: left;
    font-family: 'unscii', 'Courier New', monospace;
    font-size: 14px;
    color: #00ff00;
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: inset 0 0 5px rgba(0, 255, 0, 0.2);
}

.progress-details::-webkit-scrollbar {
    width: 8px;
}

.progress-details::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.progress-details::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
    box-shadow: 0 0 5px #00ff00;
}

.error-section {
    color: #ff0000;
}

.error-section h2 {
    color: #ff0000;
    text-shadow: 0 0 5px #ff0000;
}

.error-section #errorMessage {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ff0000;
    font-family: 'unscii', 'Courier New', monospace;
    text-shadow: 0 0 3px #ff0000;
}

footer {
    text-align: center;
    padding: 20px;
    color: rgba(0, 255, 0, 0.8);
    margin-top: 20px;
}

footer p {
    margin-bottom: 5px;
    text-shadow: 0 0 3px #00ff00;
}

footer small {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .download-form {
        padding: 20px;
    }
    
    .progress-section,
    .download-section,
    .error-section {
        padding: 20px;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .slider-container {
        flex-direction: column;
        align-items: stretch;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.pulse {
    animation: pulse 2s infinite;
}

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

.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.matrix-rain::before {
    content: "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101";
    position: absolute;
    color: rgba(0, 255, 0, 0.1);
    font-family: 'unscii', monospace;
    font-size: 12px;
    line-height: 14px;
    animation: matrix-fall 10s linear infinite;
    white-space: pre;
    word-wrap: break-word;
}

@keyframes matrix-fall {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: #00ff00;
    animation: cursor-blink 1s infinite;
    margin-left: 2px;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #000000;
    border: 1px solid #00ff00;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: rgba(0, 255, 0, 0.1);
}

.autocomplete-item .item-name {
    color: #00ff00;
    font-weight: bold;
}

.autocomplete-item .item-id {
    color: rgba(0, 255, 0, 0.6);
    font-size: 0.9em;
    margin-left: 8px;
}

/* Custom scrollbar for autocomplete */
.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.5);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.7);
}

/* Archives Section */
.archives-section {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    padding: 24px;
    margin: 32px 0;
    animation: glow 2s ease-in-out infinite alternate;
}

.archives-section h2 {
    color: #00ff00;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.archives-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loading-message {
    text-align: center;
    color: rgba(0, 255, 0, 0.7);
    font-style: italic;
    padding: 20px;
}

.no-archives-message {
    text-align: center;
    color: rgba(0, 255, 0, 0.7);
    font-style: italic;
    padding: 20px;
}

.archive-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.archive-item:hover {
    border-color: rgba(0, 255, 0, 0.5);
    background: rgba(0, 255, 0, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.2);
}

.archive-info {
    flex: 1;
    min-width: 300px;
}

.archive-title {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 1.1em;
}

.archive-meta {
    color: rgba(0, 255, 0, 0.7);
    font-size: 0.9em;
    line-height: 1.4;
}

.archive-meta .meta-item {
    margin-right: 16px;
    display: inline-block;
}

.archive-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.archive-download-btn {
    background: linear-gradient(45deg, #003300, #006600);
    color: #00ff00;
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.9em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.archive-download-btn:hover {
    background: linear-gradient(45deg, #004400, #008800);
    border-color: rgba(0, 255, 0, 0.6);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
    transform: translateY(-1px);
}

.archive-download-btn:active {
    transform: translateY(0);
}

.archive-size {
    color: rgba(0, 255, 0, 0.6);
    font-size: 0.85em;
    white-space: nowrap;
}

/* Responsive design for archives */
@media (max-width: 600px) {
    .archive-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .archive-info {
        min-width: auto;
    }
    
    .archive-actions {
        justify-content: center;
        margin-top: 8px;
    }
    
    .archive-meta .meta-item {
        display: block;
        margin-right: 0;
        margin-bottom: 4px;
    }
}