/* Shared CSS Variables for aesthetic consistency */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --accent-color: #f59e0b;
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding: 2rem 1rem;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-muted);
}

.app-main {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Format Mode Segmented Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.toggle-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Dropdown Field Styling */
.dropdown-field {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 2rem 0.5rem 1rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease-in-out;
    
    /* Clean custom arrow styling across modern browsers */
    appearance: none;
    background-image: url("chevron-down.svg");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.dropdown-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed #c7d2fe;
    background-color: #f5f3ff;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: #e0e7ff;
    transform: scale(1.01);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

.file-label {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.hidden-input {
    display: none;
}

/* Progress Bar Utilities */
.progress-container {
    margin-top: 1.5rem;
    background: #f3f4f6;
    padding: 1rem;
    border-radius: var(--radius);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    background-color: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    background-color: var(--primary-color);
    height: 100%;
    transition: width 0.2s ease;
}

/* Queue List Container */
.queue-container {
    margin-top: 2rem;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.queue-header h2 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.file-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.file-item:last-child {
    border-bottom: none;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    word-break: break-all;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-pending { background-color: #e5e7eb; color: #374151; }
.status-processing { background-color: #fef3c7; color: #92400e; }
.status-complete { background-color: #d1fae5; color: #065f46; }
.status-error { background-color: #fee2e2; color: #991b1b; }

/* Global Buttons styling */
.action-panel {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}

.btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: #ef4444;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.btn-secondary:hover {
    background-color: #fee2e2;
}

/* Helper Class */
.hidden {
    display: none !important;
}

/* ==========================================
   MODAL & POP-UP COMPONENT STYLES
   ========================================== */

/* Styles the trigger text to look and feel like a standard hyperlink */
.text-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.1s ease;
}

.text-link-btn:hover {
    color: var(--primary-hover);
}

/* Base style for the native HTML <dialog> element */
.info-modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 450px;
    width: 90%;
    margin: auto; /* Centers the dialog on screen perfectly */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Automatically fades out the main app background when the modal opens */
.info-modal::backdrop {
    background-color: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px); /* Adds a subtle glass effect */
}

/* Inner content layout */
.modal-content {
    padding: 1.75rem;
}

.modal-content h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.modal-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Bullet list alignment inside popup */
.formats-list {
    list-style-position: inside;
    margin-bottom: 1.5rem;
}

.formats-list li {
    font-size: 0.9rem;
    padding: 0.25rem 0;
    color: var(--text-main);
}

/* Footer layout for the close button alignment */
.modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* Persistent Mini Version Tag */
.app-version {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af; /* Soft gray color so it's not distracting */
    user-select: none; /* Prevents accidental highlighting */
    pointer-events: none; /* Makes sure it doesn't block background clicks */
}

/* Optional responsive adjustment: hides or scales down on ultra-small screens */
@media (max-width: 480px) {
    .app-version {
        bottom: 0.5rem;
        right: 0.5rem;
        font-size: 0.7rem;
    }
}