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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

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

header {
    text-align: center;
    padding: 40px 0 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

main {
    flex: 1;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--surface);
    padding: 8px;
    border-radius: var(--border-radius);
    flex-wrap: wrap;
}

.tab {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.tab.active {
    background: var(--primary-color);
    color: white;
}

/* Input Sections */
.input-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.input-section.active {
    display: block;
}

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

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: var(--transition);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Algorithm Selection */
.algorithm-select {
    margin-bottom: 24px;
}

.algorithm-select > label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn.secondary {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn.secondary:hover {
    background: var(--border-color);
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn.copy-btn {
    background: var(--surface-light);
    color: var(--text-primary);
    padding: 8px 12px;
}

.btn.copy-btn:hover {
    background: var(--primary-color);
}

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

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    background: var(--surface);
    transition: var(--transition);
    margin-bottom: 20px;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.file-drop-zone p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.or-text {
    font-size: 0.875rem;
}

.file-label {
    display: inline-block;
    margin-top: 12px;
    cursor: pointer;
}

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

.file-name {
    margin-top: 16px;
    color: var(--primary-color);
    font-weight: 500;
    word-break: break-all;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #a855f7);
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Results */
.results {
    margin-top: 24px;
}

.result-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

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

.result-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--background);
    padding: 12px 16px;
    border-radius: 8px;
    word-break: break-all;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Compare Results */
.compare-container {
    display: grid;
    gap: 16px;
}

.compare-result {
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.compare-result.match {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.compare-result.no-match {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--error-color);
    color: var(--error-color);
}

.compare-result .icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    header {
        padding: 30px 0 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .tabs {
        gap: 4px;
        padding: 6px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 0.85rem;
        min-width: 90px;
    }

    textarea {
        min-height: 120px;
        padding: 12px;
    }

    .file-drop-zone {
        padding: 30px 20px;
    }

    .drop-icon {
        font-size: 2.5rem;
    }

    .checkbox-group {
        gap: 16px;
    }

    .btn {
        padding: 12px 20px;
        width: 100%;
        justify-content: center;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-value {
        font-size: 0.8rem;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--success-color);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

@media (max-width: 600px) {
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}
