:root {
    --primary: #E84393;
    --secondary: #FD79A8;
    --accent: #6C5CE7;
    --bg: #1A0A14;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text: #F5F5F5;
    --text-muted: #B2BEC3;
    --radius: 12px;
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    line-height: 1.6;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(232, 67, 147, 0.15) 0%, rgba(108, 92, 231, 0.05) 50%, transparent 100%);
    filter: blur(80px);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px rgba(232, 67, 147, 0.5));
}

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

/* Tabs */
.tabs {
    display: flex;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(232, 67, 147, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

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

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Upload Card */
.upload-card {
    border: 2px dashed var(--border-color);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
}

.upload-card:hover, .upload-card.dragover {
    border-color: var(--primary);
    background: rgba(232, 67, 147, 0.03);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.icon-circle {
    width: 64px;
    height: 64px;
    background: rgba(232, 67, 147, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upload-content h3 {
    font-size: 1.5rem;
}

.upload-content p span {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

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

/* Output Area */
.output-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

.preview-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-wrapper.large {
    aspect-ratio: auto;
    min-height: 200px;
    max-height: 600px;
}

textarea {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text);
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

textarea:focus {
    border-color: var(--primary);
}

.badge {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    transition: var(--transition);
}

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

.btn.primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(232, 67, 147, 0.4);
}

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

.btn.outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text);
}

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

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

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

.result-actions, .input-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}
