:root {
    --bg-color: #0B1121;
    --terminal-bg: rgba(17, 24, 39, 0.8);
    --terminal-border: rgba(51, 65, 85, 0.6);
    --header-bg: rgba(31, 41, 55, 0.4);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --cyan-main: #06b6d4;
    --cyan-hover: #22d3ee;
    --cyan-glow: rgba(34, 211, 238, 0.4);
    --input-bg: rgba(31, 41, 55, 0.5);
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: rgba(239, 68, 68, 0.2);
    --error-text: #f87171;
    --success-text: #34d399;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(to right, #1e293b 1px, transparent 1px),
        linear-gradient(to bottom, #1e293b 1px, transparent 1px);
    background-size: 4rem 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-main);
}

.container {
    width: 100%;
    max-width: 600px;
}

.terminal-window {
    background: var(--terminal-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--terminal-border);
    border-radius: 16px;
    box-shadow: 0 0 50px -12px rgba(0,0,0,0.5);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--terminal-border);
}

.dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background-color: #ef4444; }
.dot.yellow { background-color: #eab308; }
.dot.green { background-color: #22c55e; }

.terminal-title {
    color: var(--text-muted);
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 1px;
}

.spacer { width: 44px; }

.terminal-body { padding: 32px; }

.text-center { text-align: center; }
.mb-8 { margin-bottom: 32px; }

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

p {
    color: var(--text-muted);
    font-size: 14px;
}

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

label {
    display: block;
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.input-wrapper { position: relative; }

input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: var(--input-bg);
    border: 1px solid #475569;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: var(--cyan-main);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

input[type="file"] {
    padding: 10px 16px;
    color: #94a3b8;
}

input[type="file"]::file-selector-button {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: var(--cyan-hover);
    padding: 6px 12px;
    border-radius: 6px;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(6, 182, 212, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

button[type="submit"] {
    width: 100%;
    background: var(--cyan-main);
    color: #0f172a;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 15px -3px var(--cyan-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button[type="submit"]:hover {
    background: var(--cyan-hover);
    box-shadow: 0 0 20px -3px rgba(34, 211, 238, 0.6);
}

button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid #0f172a;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

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

.hidden { display: none !important; }

.error-message {
    margin-top: 24px;
    padding: 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 12px;
    color: var(--error-text);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.result-card {
    margin-top: 32px;
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid var(--terminal-border);
    border-radius: 16px;
    overflow: hidden;
}

.result-header {
    padding: 16px 20px;
    background: rgba(31, 41, 55, 0.6);
    border-bottom: 1px solid var(--terminal-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-icon { color: var(--success-text); }

.result-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: #e2e8f0;
}

.badge {
    margin-left: auto;
    background: #1e293b;
    color: var(--cyan-hover);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid var(--terminal-border);
}

.result-body { padding: 8px; }

.document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 12px;
    transition: background 0.2s;
}

.document-row:hover { background: rgba(30, 41, 59, 0.5); }

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    padding: 8px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan-hover);
    border-radius: 8px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.doc-details h4 {
    font-size: 15px;
    color: #e2e8f0;
    font-weight: 500;
}

.doc-details p {
    font-size: 12px;
    font-family: monospace;
    margin-top: 2px;
}

.doc-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-view {
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan-hover);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.btn-view:hover { background: rgba(6, 182, 212, 0.2); }

.btn-download {
    background: var(--cyan-main);
    color: #0f172a;
}

.btn-download:hover { background: var(--cyan-hover); }

.divider {
    height: 1px;
    background: var(--terminal-border);
    margin: 0 16px;
}

@media (max-width: 600px) {
    .document-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .doc-actions { width: 100%; }
    .btn-action {
        flex: 1;
        justify-content: center;
    }
}
