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

:root {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary: #64748b;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --green: #22c55e;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --red: #ef4444;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Trust Badges */
.badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-green {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.generator-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 3rem;
}

/* Input Type Tabs */
.input-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* Input Panels */
.input-panel {
    display: none;
}

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

.input-section {
    margin-bottom: 1.5rem;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-section input[type="text"],
.input-section textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s;
    resize: vertical;
}

.input-section input:focus,
.input-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
}

.file-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.file-drop-zone p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.file-hint {
    font-size: 0.85rem;
    color: var(--secondary);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
    padding: 0;
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
}

#file-name {
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#file-size {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-small:hover {
    background: #dc2626;
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--blue));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Compare Result */
.compare-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
}

.compare-result.match {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.compare-result.no-match {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

#compare-icon {
    font-size: 1.5rem;
}

/* Algorithm Section */
.algorithm-section {
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.algorithm-section > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.algorithm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.algo-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.algo-checkbox:hover {
    border-color: var(--primary);
}

.algo-checkbox input {
    cursor: pointer;
}

.algo-checkbox input:checked + * {
    color: var(--primary);
}

.select-all-row {
    display: flex;
    gap: 1rem;
}

/* Options Row */
.options-row {
    margin-bottom: 1.5rem;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.option-checkbox input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Results Section */
.results-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.results-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.result-item {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

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

.result-algo {
    font-weight: 700;
    color: var(--primary);
}

.result-length {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.result-hash-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-hash {
    flex: 1;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.copy-btn {
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

/* Features Section */
.features {
    margin-bottom: 3rem;
}

.features h2,
.faq h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.feature {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* FAQ Section */
.faq {
    margin-bottom: 3rem;
}

.faq-category {
    margin-bottom: 2rem;
}

.faq-category-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.faq-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.faq-item h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.faq-item code {
    background: var(--background);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.75rem;
    }

    .badges {
        gap: 0.5rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .generator-card {
        padding: 1.5rem;
    }

    .input-tabs {
        gap: 0.4rem;
    }

    .tab-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .algorithm-grid {
        flex-direction: column;
    }

    .algo-checkbox {
        width: 100%;
    }

    .result-hash {
        font-size: 0.75rem;
    }

    .file-drop-zone {
        padding: 1.5rem;
    }
}

/* Print styles */
@media print {
    .generator-card,
    .features,
    .faq,
    footer,
    .badges {
        display: none !important;
    }

    .results-section {
        display: block !important;
    }
}


/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-size: 1.25rem;
    transition: transform 0.2s, background 0.3s;
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Dark mode overrides */
[data-theme="dark"] body {
    background: var(--background);
    color: var(--text);
}

[data-theme="dark"] .generator-card,
[data-theme="dark"] .feature,
[data-theme="dark"] .faq-item {
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--background);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .tab-btn {
    background: var(--background);
    color: var(--text-muted);
    border-color: var(--border);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] code {
    background: var(--background);
    color: var(--text);
}

[data-theme="dark"] .badge {
    background: var(--card-bg);
}

[data-theme="dark"] .copy-btn,
[data-theme="dark"] .btn-secondary {
    background: var(--card-bg);
    border-color: var(--border);
}
