/* ===== CSS Variables ===== */
:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --accent: #A855F7;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    --bg-dark: #0F0F1A;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* ===== Background Animation ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
        linear-gradient(135deg, #0F0F1A 0%, #1A1A2E 50%, #16162A 100%);
}

.bg-orbs {
    position: absolute;
    inset: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.2));
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.15));
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.1));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* ===== Container ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.highlight {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* ===== Main Card ===== */
.main-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow), var(--shadow-glow);
    flex: 1;
}

/* ===== Upload Section ===== */
.upload-section {
    margin-bottom: 32px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-glass);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-style: solid;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.upload-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.upload-icon svg {
    width: 36px;
    height: 36px;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px 10px rgba(99, 102, 241, 0); }
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-subtitle {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Selected File */
.selected-file {
    display: none;
    align-items: center;
    gap: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
    animation: slideIn 0.3s ease;
}

.selected-file.visible {
    display: flex;
}

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

.file-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.remove-file {
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.remove-file:hover {
    background: rgba(239, 68, 68, 0.2);
}

.remove-file svg {
    width: 18px;
    height: 18px;
    color: var(--error);
}

/* ===== Format Section ===== */
.format-section {
    margin-bottom: 32px;
    opacity: 0.5;
    pointer-events: none;
    transition: var(--transition);
}

.format-section.active {
    opacity: 1;
    pointer-events: auto;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.format-option {
    cursor: pointer;
}

.format-option input {
    display: none;
}

.format-card {
    background: var(--bg-glass);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    text-align: center;
    transition: var(--transition);
}

.format-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.format-option input:checked + .format-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.format-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.format-icon.pdf {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.format-icon.word {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.format-icon.jpeg {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.format-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.format-desc {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Convert Button ===== */
.convert-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: var(--radius-md);
    padding: 18px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.convert-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    opacity: 0;
    transition: var(--transition);
}

.convert-btn:hover:not(:disabled)::before {
    opacity: 1;
}

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

.convert-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

.btn-text, .btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.convert-btn:hover:not(:disabled) .btn-icon svg {
    transform: translateX(4px);
}

/* ===== Progress Section ===== */
.progress-section {
    display: none;
    margin-top: 24px;
    animation: fadeIn 0.3s ease;
}

.progress-section.visible {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.progress-bar {
    height: 8px;
    background: var(--bg-glass);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Result Section ===== */
.result-section,
.error-section {
    display: none;
    text-align: center;
    padding: 32px 0;
    animation: scaleIn 0.4s ease;
}

.result-section.visible,
.error-section.visible {
    display: block;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon.success {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
}

.result-icon.error {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.result-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-title {
    color: var(--error);
}

.result-subtitle,
.error-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.download-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    margin-bottom: 16px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

.new-file-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.new-file-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .container {
        padding: 24px 16px;
    }
    
    .main-card {
        padding: 24px 20px;
    }
    
    .upload-area {
        padding: 32px 16px;
    }
    
    .format-options {
        gap: 8px;
    }
    
    .format-card {
        padding: 16px 8px;
    }
    
    .format-icon {
        width: 40px;
        height: 40px;
    }
    
    .format-name {
        font-size: 0.875rem;
    }
}

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