/* ================================================
   EPUB to PDF Converter - Premium Styles
   ================================================ */

/* CSS Variables / Design Tokens */
:root {
    /* Colors */
    --color-bg-primary: #0a0a1a;
    --color-bg-secondary: #111127;
    --color-bg-card: rgba(17, 17, 39, 0.8);
    --color-bg-card-hover: rgba(25, 25, 55, 0.9);
    
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    
    --color-accent-primary: #6366f1;
    --color-accent-secondary: #8b5cf6;
    --color-accent-tertiary: #ec4899;
    
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 50%, rgba(236, 72, 153, 0.4) 100%);
    --gradient-card: linear-gradient(145deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Borders */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 28px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Particles Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    padding: 8rem 1.5rem 4rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--color-accent-primary);
    margin-bottom: 1.5rem;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    color: var(--color-text-primary);
}

.title-gradient {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Converter Card */
.converter-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--border-radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Dropzone */
.dropzone {
    position: relative;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.dropzone:hover {
    transform: translateY(-2px);
}

.dropzone.drag-over {
    transform: scale(1.02);
}

.dropzone.drag-over .dropzone-border {
    border-color: var(--color-accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.dropzone-border {
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-normal);
}

.upload-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: bounce 2s infinite;
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.dropzone-text {
    text-align: center;
}

.dropzone-title {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
}

.dropzone-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

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

.file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-sm);
}

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

.file-details {
    flex: 1;
}

.file-name {
    display: block;
    font-weight: 600;
    color: var(--color-text-primary);
    word-break: break-word;
}

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

.remove-file {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

/* Progress */
.progress-container {
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.progress-status {
    font-weight: 500;
    color: var(--color-text-primary);
}

.progress-percentage {
    font-weight: 700;
    color: var(--color-accent-primary);
}

.progress-bar {
    position: relative;
    height: 8px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--gradient-primary);
    border-radius: 100px;
    transition: width 0.3s ease;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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%);
    }
}

/* Convert Button */
.convert-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.convert-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

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

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

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

.convert-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

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

/* Success Message */
.success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    animation: scaleIn 0.4s ease;
}

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

.success-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--color-success);
    border-radius: 50%;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-success);
}

.success-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-success);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--color-success);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

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

/* Error Message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

.error-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--color-error);
    border-radius: 50%;
}

.error-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-error);
}

.error-text {
    font-size: 1rem;
    color: var(--color-error);
}

.retry-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--color-error);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-error);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    padding: 1.75rem;
    background: var(--gradient-card);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.8s ease-out backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.4s; }
.feature-card:nth-child(2) { animation-delay: 0.5s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--border-radius-md);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-accent-primary);
}

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

.feature-description {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .main-content {
        padding: 6rem 1rem 3rem;
    }
    
    .converter-card {
        padding: 1.5rem;
    }
    
    .dropzone {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        width: 56px;
        height: 56px;
    }
    
    .upload-icon svg {
        width: 28px;
        height: 28px;
    }
}
