/* Modern CSS Reset & Core Styling System */
:root {
    --bg-dark: #090a10;
    --card-bg: rgba(18, 20, 38, 0.55);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-hover-border: rgba(99, 102, 241, 0.35);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.45);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.4);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.25);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

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

/* Ambient Glowing Background Orbs */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    animation: pulse 12s infinite alternate ease-in-out;
}

.orb-primary {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    animation-duration: 15s;
}

.orb-secondary {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    animation-duration: 12s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
    100% { transform: scale(1.15) translate(4%, 3%); opacity: 0.35; }
}

/* Application Container Layout */
.app-container {
    width: 100%;
    max-width: 860px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Glassmorphic Card Styling */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Navigation Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h1 span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.security-badge svg {
    color: var(--secondary);
}

/* Main Converter Dashboard */
.converter-board {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mode Selection Section */
.mode-selector-section {
    display: flex;
    justify-content: center;
}

.mode-toggles {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 0.35rem;
    gap: 0.25rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.75rem;
    border-radius: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.mode-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), rgba(99, 102, 241, 0.6));
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Drag & Drop File Container */
.drop-zone {
    position: relative;
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(18, 20, 38, 0.35);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
    box-shadow: 0 0 24px var(--primary-glow);
    transform: translateY(-2px);
}

.file-input-hidden {
    display: none;
}

.upload-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.upload-arrow {
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.drop-zone:hover .upload-arrow, .drop-zone.dragover .upload-arrow {
    color: var(--primary);
    transform: translateY(-6px);
    animation: bounce 1.5s infinite alternate ease-in-out;
}

@keyframes bounce {
    0% { transform: translateY(-3px); }
    100% { transform: translateY(-9px); }
}

.instructions h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

.instructions p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.browse-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.file-type-hint {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Panels (Queue and History Panels) */
.panel-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
}

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

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.badge {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

/* Queue List & Queue Row Items */
.queue-list, .history-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Webkit Scrollbar custom styling */
.queue-list::-webkit-scrollbar, .history-list::-webkit-scrollbar {
    width: 6px;
}
.queue-list::-webkit-scrollbar-thumb, .history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.queue-list::-webkit-scrollbar-track, .history-list::-webkit-scrollbar-track {
    background: transparent;
}

.queue-item, .history-item {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.85rem;
    transition: all 0.3s ease;
}

.queue-item:hover, .history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.icon-pdf {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.icon-docx {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.file-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 550;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

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

/* Actions and Status */
.status-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-badge {
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-queued {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-converting {
    background: rgba(6, 182, 212, 0.12);
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.15);
    animation: pulse-glow 1.5s infinite alternate ease-in-out;
}

.status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 4px rgba(6, 182, 212, 0.1); }
    100% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.35); }
}

.remove-btn, .download-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.remove-btn {
    color: var(--text-muted);
}
.remove-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.download-btn {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.download-btn:hover {
    background: rgba(16, 185, 129, 0.22);
    box-shadow: 0 0 12px var(--success-glow);
    transform: translateY(-1px);
}

/* Progress bar inside card */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-bar.loading {
    animation: flow-progress 2s infinite linear;
    background-size: 200% 100%;
}

@keyframes flow-progress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Panel Footer Action Buttons */
.panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    align-items: center;
}

.primary-action-btn, .secondary-action-btn {
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-action-btn {
    padding: 0.85rem 1.85rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.primary-action-btn:hover {
    box-shadow: 0 6px 22px var(--primary-glow);
    transform: translateY(-1.5px);
}

.primary-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-action-btn {
    padding: 0.85rem 1.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

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

/* Toast Message Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    max-width: 320px;
    background: rgba(18, 20, 38, 0.85);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 0.85rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    box-shadow: 0 4px 16px var(--danger-glow);
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
    box-shadow: 0 4px 16px var(--success-glow);
}

/* Footer Section */
.app-footer {
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

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