:root {
    --bg-color: #08090f;
    --card-bg: rgba(16, 18, 27, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(138, 75, 250, 0.4);
    
    --primary: #8a4bfa;
    --primary-gradient: linear-gradient(135deg, #8a4bfa 0%, #c44bf0 100%);
    --primary-glow: rgba(138, 75, 250, 0.35);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Ambient Glow */
.background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(138, 75, 250, 0.12) 0%, rgba(196, 75, 240, 0.03) 60%, rgba(0, 0, 0, 0) 100%);
    z-index: 0;
    pointer-events: none;
    filter: blur(80px);
}

.app-container {
    width: 100%;
    max-width: 580px;
    padding: 24px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header Styles */
.app-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--primary-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    box-shadow: 0 8px 30px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.logo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    animation: shine 4s infinite linear;
}

@keyframes shine {
    0% { transform: translate(-30%, -30%) rotate(45deg); }
    100% { transform: translate(30%, 30%) rotate(45deg); }
}

.logo i {
    font-size: 32px;
    color: #ffffff;
}

.app-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 440px;
}

/* Glassmorphism Card */
.converter-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: var(--transition-smooth);
}

.converter-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* Drag & Drop Area */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.01);
    position: relative;
    overflow: hidden;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(138, 75, 250, 0.04);
    box-shadow: 0 0 20px rgba(138, 75, 250, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 40px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: translateY(-5px);
}

.drop-zone h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-zone p {
    font-size: 13px;
    color: var(--text-secondary);
}

.browse-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.file-limits {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* File Details View */
.file-details {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    text-align: left;
    animation: fadeIn 0.3s ease;
}

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

.pdf-file-icon {
    font-size: 32px;
    color: var(--danger);
    filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.2));
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow: hidden;
}

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

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

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

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 13px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Action Button */
.action-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px var(--primary-glow);
    transition: var(--transition-smooth);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(138, 75, 250, 0.5);
}

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

.action-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Progress & Loading View */
.progress-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    animation: fadeIn 0.3s ease;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3.5px solid rgba(255, 255, 255, 0.05);
    border-top: 3.5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-container h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-container p {
    font-size: 13px;
    color: var(--text-secondary);
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.4s ease;
    animation: pulseGlow 1.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

/* Success View */
.success-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

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

.success-icon {
    font-size: 32px;
    color: var(--success);
    filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.3));
}

.success-container h3 {
    font-size: 18px;
    font-weight: 700;
}

.success-container p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
    margin-bottom: 8px;
}

.success-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.success-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    transform: translateY(-2px);
}

/* Footer Styles */
.app-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.app-footer i {
    color: var(--primary);
    margin-right: 4px;
}

.copyright {
    font-size: 11px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .converter-card {
        padding: 24px;
    }
    
    .app-header h1 {
        font-size: 26px;
    }
}
