:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

textarea {
    width: 100%;
    height: 180px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

.result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: none;
}

.result-section.visible {
    display: block;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.hash-display {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 1rem;
    border-radius: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    word-break: break-all;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.hash-display:hover {
    background: rgba(16, 185, 129, 0.15);
}

.help-text {
    margin-top: 1.5rem;
    text-align: center;
}

.help-trigger {
    color: var(--primary);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.help-trigger:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 20px;
    max-width: 800px;
    /* Increased from 500px */
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

.gif-placeholder {
    width: 100%;
    background: var(--bg-dark);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow: auto;
    /* Allow scrolling if content is very tall */
    flex-grow: 1;
}

.gif-placeholder video,
.gif-placeholder img {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    border-radius: 12px;
    display: block;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .hash-display {
        font-size: 0.85rem;
    }
}