:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #8b5cf6;
    /* Violet */
    --accent-secondary: #3b82f6;
    /* Blue */
    --surface-dark: rgba(20, 20, 25, 0.6);
    --surface-card: rgba(30, 30, 35, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --neon-cyan: #00f3ff;
    --neon-purple: #bd00ff;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.bg-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, rgba(5, 5, 5, 0) 50%);
    z-index: -2;
    animation: pulse 10s ease-in-out infinite;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 9999px;
    color: #c4b5fd;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Input Section */
.input-section {
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.input-wrapper {
    position: relative;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 4px 30px rgba(139, 92, 246, 0.2);
}

.input-wrapper .icon {
    font-size: 1.5rem;
    color: #ff0000;
    margin: 0 1rem;
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 1rem 0;
    font-family: var(--font-heading);
}

input:focus {
    outline: none;
}

input::placeholder {
    color: #555;
}

button#submitBtn {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

button#submitBtn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

button#submitBtn:active {
    transform: translateY(0);
}

button#submitBtn:disabled {
    opacity: 1;
    cursor: wait;
    filter: none;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

/* Features Grid */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1rem;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-secondary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 2rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Comparison Section */
.comparison-section {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 0 1rem;
    animation: fadeIn 0.8s ease-out 0.4s backwards;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

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

.comparison-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.comparison-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.card-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.vs-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vs-item .bad {
    color: #ff5f56;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vs-item .bad::before {
    content: "✕";
}

.vs-item .good {
    color: #27c93f;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vs-item .good::before {
    content: "✓";
}

.vs-item .desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Status Terminal */
.status-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.terminal-header {
    background: #1a1a1a;
    padding: 0.75rem 1rem;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.dots {
    display: flex;
    gap: 6px;
}

.dots span {
    width: 10px;
    height: 10px;
    background: #444;
    border-radius: 50%;
}

.dots span:nth-child(1) {
    background: #ff5f56;
}

.dots span:nth-child(2) {
    background: #ffbd2e;
}

.dots span:nth-child(3) {
    background: #27c93f;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #777;
    letter-spacing: 0.1em;
}

.terminal-body {
    background: rgba(10, 10, 12, 0.95);
    padding: 1rem;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.log-entry {
    color: #d4d4d4;
    padding-left: 1rem;
    border-left: 2px solid #333;
    animation: slideInLeft 0.3s ease-out;
}

.log-entry.latest {
    border-left-color: var(--accent-primary);
    color: white;
}

.log-entry.error {
    border-left-color: #ff5555;
    color: #ff5555;
}

/* Result Section */
.result-section {
    animation: fadeInUp 0.8s ease-out;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.result-content {
    background: var(--surface-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    line-height: 1.7;
    color: #e0e0e0;
}

/* Markdown Styling (simplified GitHub Dark-ish + Custom) */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: white;
    font-family: var(--font-heading);
}

.markdown-body h1 {
    font-size: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.markdown-body h2 {
    font-size: 1.6rem;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul,
.markdown-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-body code {
    background: rgba(139, 92, 246, 0.15);
    color: #d8b4fe;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.markdown-body pre {
    background: #111;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body pre code {
    background: transparent;
    color: #ccc;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
    font-style: italic;
}

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

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

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

/* Password Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInUp 0.5s ease-out;
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-content h2 i {
    color: var(--accent-primary);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Google Login Button */
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: white;
    border: none;
    border-radius: 8px;
    color: #1f1f1f;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.google-login-btn:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.google-login-btn svg {
    flex-shrink: 0;
}

/* User Bar */
.user-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 6px 16px 6px 6px;
    z-index: 100;
}

.user-info-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-bar span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logout-btn {
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4px;
    transition: color 0.2s;
    text-decoration: none;
}


.logout-btn:hover {
    color: #ff5555;
}

/* Landing Page Extensions */
.landing-section {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 3rem;
}

.demo-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.demo-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
}

.demo-placeholder {
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.demo-placeholder:hover {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.05);
}

.demo-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    color: var(--accent-primary);
}

.profile-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
}

@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    object-fit: cover;
}

.profile-content h3 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-family: var(--font-heading);
}

.profile-content p {
    color: var(--text-secondary);
}

/* Demo Terminal Animation */
.demo-terminal-window {
    background: #0f0f12;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-align: left;
    height: 360px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.demo-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #e0e0e0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cursor-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #a0a0a0;
}

.prompt {
    color: var(--accent-secondary);
    font-weight: bold;
}

.command-text {
    color: white;
}

.log-line {
    animation: slideInLeft 0.3s ease-out;
    line-height: 1.5;
    word-break: break-word;
}

.log-line.info {
    color: #a0a0a0;
}

.log-line.success {
    color: #27c93f;
}

.log-line.warn {
    color: #ffbd2e;
}

.log-line.error {
    color: #ff5f56;
}

.log-line.highlight {
    color: #d8b4fe;
    font-weight: bold;
}

.log-line.system {
    color: #3b82f6;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: var(--text-secondary);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.demo-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 10;
}

#replayDemoBtn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

#replayDemoBtn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.auth-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(219, 68, 55, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(5px);
}

.auth-section h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.auth-section p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-btn-wrapper {
    max-width: 300px;
    margin: 0 auto;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ri-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Settings UI */
/* Settings UI */
.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    /* Perfect Pill Shape */
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0 16px;
    /* Horizontal Padding only, let height controls vertical */
    height: 36px;
    /* Fixed height for perfect centering */
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure content is centered */
    gap: 8px;
    line-height: normal;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-content {
    text-align: left;
    max-width: 500px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

.settings-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

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

.input-group label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 8px;
    color: white;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.input-group small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.save-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Mode Tabs - Premium Redesign */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem;
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

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

.tab-btn.active {
    background: var(--bg-card);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.tab-btn.active i {
    color: var(--accent-primary);
}

.mode-content {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-content.active {
    display: block;
}

/* Upload Drop Zone - Enhanced */
.upload-wrapper {
    background: rgba(20, 20, 24, 0.6);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    max-width: 680px;
    margin: 2rem auto;
    /* Centered with vertical spacing */
    backdrop-filter: blur(10px);
    display: flex;
    /* Flexbox for centering content */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-wrapper:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.upload-wrapper.dragover {
    border-color: var(--accent-primary);
    background: rgba(138, 43, 226, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: block;
    transition: color 0.3s;
}

.upload-wrapper:hover .upload-icon {
    color: var(--accent-primary);
}

.upload-wrapper h3 {
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
}

.upload-wrapper p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

#pdfInput {
    margin-top: 1rem;
    max-width: 100%;
    position: relative;
    z-index: 10;
}

.file-info {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(138, 43, 226, 0.3);
    animation: fadeIn 0.3s;
}

.file-info span {
    color: var(--text-primary);
    font-weight: 500;
}

.remove-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #ff5555;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
}

.remove-btn:hover {
    background: rgba(255, 85, 85, 0.2);
    transform: rotate(90deg);
}

.generate-btn {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border: none;
    border-radius: 12px;
    padding: 1rem 2.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
    position: relative;
    z-index: 100;
}

.generate-btn:disabled,
.generate-btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.8);
    box-shadow: none;
    transform: none !important;
}

.generate-btn:not(:disabled):not(.btn-disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.5);
    filter: brightness(1.1);
}

.api-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.api-link:hover {
    color: var(--accent-primary);
    color: var(--accent-primary);
    text-decoration: underline;
}

/* =========================================
   Codia-Style Grid View (Preview Step)
   ========================================= */

.step-container {
    animation: fadeInUp 0.5s ease-out;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-left h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: white;
}

.count-badge {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    gap: 1rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-text:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Grid Layout */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
    /* Space for shadows */
}

.grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1e;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 16/9;
    /* PPT default */
}

/* Image */
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.grid-item:hover img {
    opacity: 1;
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Selected State */
.grid-item.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.3);
}

.grid-item.selected img {
    opacity: 1;
}

/* Checkbox Overlay */
.checkbox-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
    z-index: 10;
}

#startPreviewBtn {
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

#startPreviewBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.grid-item.selected .checkbox-overlay {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Page Number */
.page-number {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
}

/* Actions Footer */
.preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Progress Bar */
.progress-container {
    width: 300px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin: 15px auto;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 5px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    width: 300px;
    margin: 5px auto;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 16px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: var(--accent-primary);
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Web Slide Editor Styles --- */

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-workspace {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* Image wider than form */
    gap: 2rem;
    height: calc(100vh - 300px);
    min-height: 500px;
}

/* Left: Image Preview */
.editor-preview {
    background: #18181b;
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.preview-card {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.badge-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* Right: Edit Form */
.editor-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.editor-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.editor-form label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-form textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
}

.editor-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

#editTitle {
    font-weight: 700;
    font-size: 1.2rem;
}

.editor-form small {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .editor-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
    }

    .editor-preview {
        min-height: 300px;
    }
}

/* Title Logo */
.hero-logo {
    height: 2.2em;
    width: auto;
    vertical-align: middle;
    margin-right: 12px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

@media (max-width: 768px) {

    /* Mobile Header Layout: Stack Logo and Text */
    header h1 {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .hero-logo {
        height: 6em;
        /* Big Logo on Mobile */
        width: auto;
        margin-right: 0;
        margin-bottom: 10px;
        display: block;
    }
}