@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #fb923c;
    --accent-dark: #ea580c;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
    --panel-bg: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

/* ── Background Blobs ── */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--primary-gradient);
    filter: blur(150px);
    opacity: 0.08;
    border-radius: 50%;
    top: -100px;
    left: -100px;
    animation: blobMove 20s infinite alternate linear;
}

.blob-2 {
    bottom: -100px;
    right: -100px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    animation-delay: -10s;
}

@keyframes blobMove {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 50px);
    }
}

/* ── Container ── */
.tool-container {
    width: 100%;
    max-width: 1000px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    margin: 1rem auto;
}

/* ── Header ── */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-secondary);
}

/* ── Tab System ── */
.tab-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: fit-content;
    margin-inline: auto;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Text Mode ── */
.text-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
}

textarea {
    width: 100%;
    height: 180px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    padding: 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
    margin-bottom: 1.5rem;
}

textarea:focus {
    border-color: var(--accent);
}

.hash-result-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.hash-val {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    word-break: break-all;
}

/* ── File Mode ── */
.drop-zone {
    width: 100%;
    height: 220px;
    border: 2px dashed var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.015);
    margin-bottom: 2rem;
}

.drop-zone:hover,
.drop-zone.dragover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent);
}

.drop-icon {
    font-size: 3rem;
    color: var(--text-secondary);
}

.file-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-card {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

.file-info {
    overflow: hidden;
}

.file-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-hash-row {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-hash-val {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    background: rgba(15, 23, 42, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    flex: 1;
}

/* ── Progress Bar ── */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 0.5rem;
    display: none;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.1s linear;
}

/* ── Buttons ── */
.btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.25s;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-copy-small {
    padding: 0.4rem 0.8rem;
    background: rgba(251, 146, 60, 0.15);
    color: var(--accent);
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-copy-small:hover {
    background: var(--accent);
    color: white;
}

.btn-copy-small.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tool-container {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .file-card {
        grid-template-columns: 1fr;
    }

    .file-hash-row {
        flex-direction: column;
        align-items: stretch;
    }
}