@import url('https://fonts.googleapis.com/css2?family=Doto:wght@100..900&display=swap');

:root[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --accent-primary: #00ff88;
    --accent-secondary: #00cc6a;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --success-color: #3fb950;
    --error-color: #f85149;
    --scanline-opacity: 0.02;
    --matrix-opacity: 0.02;
    --shadow-color: rgba(0, 255, 136, 0.15);
}

:root[data-theme="light"] {
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --accent-primary: #059669;
    --accent-secondary: #047857;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #dc2626;
    --scanline-opacity: 0.005;
    --matrix-opacity: 0.003;
    --shadow-color: rgba(5, 150, 105, 0.12);
}

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

html, body {
    overflow-x: hidden;
    max-width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.scanline {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 136, var(--scanline-opacity)) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 255, 136, var(--scanline-opacity)) 3px
    );
    pointer-events: none;
    z-index: 9999;
}

.matrix-bg {
    position: fixed;
    inset: 0;
    opacity: var(--matrix-opacity);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 12px var(--accent-primary);
}

.header-scan {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: scan 4s infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

h1 {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
    letter-spacing: 2px;
    font-family: 'Doto', 'Courier New', monospace;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
    letter-spacing: 0.3px;
    font-family: 'Courier New', monospace;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.upload-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.upload-card:hover {
    box-shadow: 0 6px 16px var(--shadow-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.95); }
}

.security-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

:root[data-theme="light"] .security-notice {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.6);
    border-left: 3px solid #f59e0b;
}

.notice-icon {
    font-size: 20px;
    line-height: 1;
    opacity: 0.9;
}

.notice-content { flex: 1; }

.notice-title {
    color: #ffc107;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
}

:root[data-theme="light"] .notice-title {
    color: #d97706;
    font-weight: 700;
}

.notice-text {
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.5;
}

:root[data-theme="light"] .notice-text {
    color: #292524;
    font-weight: 500;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    position: relative;
    margin-bottom: 20px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px var(--shadow-color);
}

.upload-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 13px;
}

input[type="file"] { display: none; }

.file-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-info.show { display: block; }

.info-label {
    color: var(--accent-primary);
    font-size: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
}

.file-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-container {
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
}

.progress-container.show { display: block; }

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.progress-percentage {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

.progress-bar-bg {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 6px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
    box-shadow: 0 0 8px var(--accent-primary);
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.btn {
    width: 100%;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-primary:not(:disabled):hover {
    box-shadow: 0 6px 16px var(--shadow-color);
    transform: translateY(-2px);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.btn-primary:hover::before { left: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alert {
    padding: 16px 18px;
    margin-top: 20px;
    display: none;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
}

.alert.show { display: block; }

.alert-success {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid var(--success-color);
    border-left-width: 3px;
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--error-color);
    border-left-width: 3px;
    color: var(--error-color);
}

.alert-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--success-color);
}

.url-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 10px;
}

.url-label {
    color: var(--accent-primary);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.result-url {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    word-break: break-all;
    color: var(--text-primary);
}

.copy-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #ffffff;
}

footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 40px;
    letter-spacing: 0.3px;
}

@media (max-width: 640px) {
    .container { padding: 16px; }
    h1 { font-size: 20px; }
    .subtitle { font-size: 11px; }
    .upload-card { padding: 20px; }
    .upload-zone { padding: 36px 16px; }
    .theme-toggle { width: 36px; height: 36px; font-size: 16px; }
}