/* ============================================
   Slide → Doc Converter — Premium Glassmorphism
   ============================================ */

:root {
    /* Colors — brighter dark palette */
    --bg-primary: #0f1028;
    --bg-secondary: #181a3a;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --accent-primary: #7c5cfc;
    --accent-secondary: #a78bfa;
    --accent-pink: #f472b6;
    --accent-cyan: #22d3ee;
    --accent-glow: rgba(124, 92, 252, 0.35);
    --text-primary: #f0f0ff;
    --text-secondary: #b0b0d0;
    --text-muted: #7878a8;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.22);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-bg-strong: rgba(255, 255, 255, 0.12);
    --success: #34d399;
    --success-glow: rgba(52, 211, 153, 0.25);
    --error: #f87171;
    --error-glow: rgba(248, 113, 113, 0.2);

    /* Sizing */
    --max-width: 900px;
    --radius: 20px;
    --radius-sm: 14px;
    --glass-blur: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Animated background gradient orbs ---- */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(100px);
}

body::before {
    width: 600px;
    height: 600px;
    top: -10%;
    left: -5%;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.25) 0%, rgba(124, 92, 252, 0.05) 60%, transparent 80%);
    animation: floatOrb1 12s ease-in-out infinite;
}

body::after {
    width: 500px;
    height: 500px;
    bottom: -10%;
    right: -5%;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.2) 0%, rgba(34, 211, 238, 0.08) 50%, transparent 80%);
    animation: floatOrb2 15s ease-in-out infinite;
}

@keyframes floatOrb1 {

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

    33% {
        transform: translate(60px, 40px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 80px) scale(0.95);
    }
}

@keyframes floatOrb2 {

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

    33% {
        transform: translate(-50px, -60px) scale(1.05);
    }

    66% {
        transform: translate(40px, -30px) scale(0.9);
    }
}

/* Third gradient orb via extra pseudo on .app-container */
.app-container::before {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, rgba(124, 92, 252, 0.05) 50%, transparent 80%);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: floatOrb3 18s ease-in-out infinite;
}

@keyframes floatOrb3 {

    0%,
    100% {
        transform: translateX(-50%) translate(0, 0);
    }

    50% {
        transform: translateX(-50%) translate(30px, -50px);
    }
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.app-header {
    text-align: center;
    padding: 48px 0 36px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 40px;
    filter: drop-shadow(0 0 16px var(--accent-glow));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.logo h1 {
    font-size: 34px;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #f472b6, #22d3ee);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ---- Main ---- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-bottom: 40px;
}

/* ---- Step Sections — Glassmorphism ---- */
.step-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.5s ease-out;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.step-section:hover {
    border-color: var(--border-color-hover);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

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

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

.step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 0 20px var(--accent-glow), 0 0 6px rgba(244, 114, 182, 0.3);
}

.step-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Mode Tabs ---- */
.mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mode-tab {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 22px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: var(--text-primary);
    text-align: center;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.mode-tab:hover {
    border-color: var(--border-color-hover);
    background: var(--glass-bg-strong);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.mode-tab.active {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.15), rgba(244, 114, 182, 0.08));
    box-shadow:
        0 0 24px var(--accent-glow),
        inset 0 0 24px rgba(124, 92, 252, 0.06),
        0 0 0 1px rgba(124, 92, 252, 0.3);
}

.mode-icon {
    font-size: 30px;
}

.mode-label {
    font-size: 16px;
    font-weight: 600;
}

.mode-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ---- Upload ---- */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.upload-grid.two-columns {
    grid-template-columns: 1fr 1fr;
}

.upload-card {
    position: relative;
}

.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-secondary);
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.08), rgba(244, 114, 182, 0.05));
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(124, 92, 252, 0.15);
}

.upload-zone.drag-over {
    box-shadow:
        0 0 40px var(--accent-glow),
        inset 0 0 20px rgba(124, 92, 252, 0.05);
    border-color: var(--accent-primary);
}

.upload-icon {
    font-size: 44px;
    opacity: 0.85;
}

.upload-primary {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-secondary {
    font-size: 13px;
    color: var(--text-muted);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius-sm);
    margin-top: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.file-icon {
    font-size: 18px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.file-remove:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

/* ---- Preview ---- */
.preview-container {
    display: grid;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.preview-container::-webkit-scrollbar {
    width: 6px;
}

.preview-container::-webkit-scrollbar-thumb {
    background: var(--border-color-hover);
    border-radius: 3px;
}

/* Slide preview cards in the grid */
.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.slide-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.25s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.slide-card:hover {
    border-color: var(--border-color-hover);
    background: var(--glass-bg-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.slide-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.slide-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.slide-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.slide-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.slide-bullets li {
    font-size: 12px;
    color: var(--text-muted);
    padding: 2px 0;
    padding-left: 12px;
    position: relative;
}

.slide-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-secondary);
}

.slide-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.slide-meta span {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Action Bar ---- */
.action-bar {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.btn-convert {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 16px 52px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.35s ease;
    box-shadow:
        0 4px 24px var(--accent-glow),
        0 2px 8px rgba(244, 114, 182, 0.2);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-convert::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-convert:hover:not(:disabled)::before {
    left: 100%;
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow:
        0 8px 36px rgba(124, 92, 252, 0.45),
        0 4px 12px rgba(244, 114, 182, 0.3);
}

.btn-convert:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 20px;
}

/* ---- Progress ---- */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-pink), var(--accent-cyan));
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
    background-size: 300% 100%;
    animation: shimmer 2.5s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 300% 0;
    }

    100% {
        background-position: -300% 0;
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.progress-percent {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-step {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
}

.progress-animation {
    padding: 8px 0;
}

.dot-pulse {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.dot-pulse::before,
.dot-pulse::after,
.dot-pulse {
    position: relative;
}

.dot-pulse::before,
.dot-pulse::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
    animation: dotPulse 1.5s ease-in-out infinite;
}

.dot-pulse::after {
    animation-delay: 0.3s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* ---- Result ---- */
.result-card {
    text-align: center;
    padding: 24px 0;
}

.result-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
    }

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

.result-card h2 {
    font-size: 26px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--success), #6ee7b7, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-filename {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-download {
    background: linear-gradient(135deg, #059669, #34d399);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow: 0 4px 20px var(--success-glow);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-download:hover::before {
    left: 100%;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(52, 211, 153, 0.35);
}

.btn-reset {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 15px 32px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.btn-reset:hover {
    border-color: var(--border-color-hover);
    background: var(--glass-bg-strong);
    transform: translateY(-1px);
}

/* ---- Error ---- */
.error-card {
    text-align: center;
    padding: 24px 0;
}

.error-icon {
    font-size: 52px;
    margin-bottom: 12px;
}

.error-card h2 {
    color: var(--error);
    margin-bottom: 12px;
}

.error-message {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: var(--radius-sm);
    text-align: left;
    word-break: break-word;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* ---- Footer ---- */
.app-footer {
    text-align: center;
    padding: 28px 0;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .mode-tabs {
        grid-template-columns: 1fr;
    }

    .upload-grid.two-columns {
        grid-template-columns: 1fr;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .logo h1 {
        font-size: 26px;
    }

    .step-section {
        padding: 20px;
    }

    .btn-convert {
        width: 100%;
        justify-content: center;
    }
}