@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, #6366f1 0%, #a855f7 100%);
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #a855f7;
    --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);
    --input-bg: rgba(15, 23, 42, 0.6);
}

* {
    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;
    padding: 2rem;
    overflow-x: hidden;
}

/* ── Background Blobs ── */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--primary-gradient);
    filter: blur(120px);
    opacity: 0.1;
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.blob-2 {
    bottom: -100px;
    left: -100px;
    background: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
}

/* ── Main Layout ── */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.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);
}

/* ── Inputs ── */
.section-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

textarea {
    width: 100%;
    height: 150px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    padding: 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.3s;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

/* ── File Upload ── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.01);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(168, 85, 247, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.upload-text p {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-text span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

#fileInput {
    display: none;
}

/* ── Actions ── */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    flex: 1;
    max-width: 300px;
    justify-content: center;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Results ── */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hash-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hash-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-name {
    color: #fff;
    font-weight: 600;
}

.hash-output-wrapper {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.hash-output {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--accent);
}

.copy-mini {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.copy-mini:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Options ── */
.options-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.option-item input {
    accent-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tool-container {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .btn-primary {
        width: 100%;
        max-width: none;
    }

    .controls {
        flex-direction: column;
    }
}