:root {
    /* Light/Dark Mode variables */
    --bg-primary: #f5f7fb;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --primary: #4f46e5;
    --primary-light: #e0e7ff;
    --primary-dark: #3730a3;
    --accent: #ec4899; /* Pink accent */
    --border: #e2e8f0;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-card: #151d30;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary: #6366f1;
    --primary-light: #1e293b;
    --primary-dark: #4f46e5;
    --accent: #ec4899;
    --border: #1e293b;
    --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

header {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.theme-toggle {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 0.6rem;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem 3rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 992px) {
    .layout-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.layout-grid > div {
    min-width: 0;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 2.25rem;
    transition: var(--transition);
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* File Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    margin-bottom: 1.5rem;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

[data-theme="dark"] .upload-area:hover, [data-theme="dark"] .upload-area.dragover {
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    width: 54px;
    height: 54px;
    color: var(--primary);
    transition: var(--transition);
}

.upload-area:hover .upload-icon {
    transform: translateY(-4px) scale(1.05);
}

.upload-text {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.upload-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Uploaded Files Container */
.files-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* File Item Card */
.file-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: var(--transition);
}

.file-item:hover {
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .file-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.file-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    min-width: 0;
}

.file-icon {
    color: #ef4444; /* PDF Red */
    flex-shrink: 0;
}

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

.file-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.action-icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.action-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

[data-theme="dark"] .action-icon-btn:hover {
    background: rgba(99, 102, 241, 0.15);
}

.action-icon-btn.btn-remove:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fee2e2;
}

[data-theme="dark"] .action-icon-btn.btn-remove:hover {
    background: rgba(239, 68, 68, 0.15);
}

.action-icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.action-icon-btn.active-action {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* File item expanded configuration block */
.file-option-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
    animation: slideDown 0.25s ease-out;
}

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

/* File Controls Form Row */
.file-controls-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    border-top: 1px dashed var(--border);
    padding-top: 0.75rem;
}

@media (min-width: 576px) {
    .file-controls-row {
        grid-template-columns: 1.2fr 1fr;
    }
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-range, .input-password {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.input-range:focus, .input-password:focus {
    border-color: var(--primary);
}

.rotation-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rotation-badge {
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    min-width: 60px;
    text-align: center;
}

[data-theme="dark"] .rotation-badge {
    background: rgba(99, 102, 241, 0.15);
}

/* Settings Form elements */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-select, .form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-select:focus, .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

[data-theme="dark"] .form-select:focus, [data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ----------------------------------------------------
   Tab Panel Styles
   ---------------------------------------------------- */
.tabs-container {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    overflow: hidden;
    margin-top: 1rem;
}

.tabs-header {
    display: flex;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.03);
    border-bottom: 1px solid var(--border);
    scroll-behavior: smooth;
    scrollbar-width: none;
}

[data-theme="dark"] .tabs-header {
    background: rgba(0, 0, 0, 0.2);
}

.tabs-header::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-card);
}

.tabs-content {
    background: var(--bg-card);
    padding: 1.5rem;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.30s ease;
}

.tab-pane.active {
    display: block;
}

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

.preferences-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 576px) {
    .preferences-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.full-width {
    grid-column: 1 / -1;
}

.grid-3-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 576px) {
    .grid-3-col {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Custom Checkbox and Toggle Switches */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    outline: none;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 1.65rem;
    display: block;
    margin-top: -0.25rem;
}

/* Privacy Notice & Disclaimer */
.privacy-disclaimer {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.privacy-disclaimer svg {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 2px;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: none;
}

.alert-danger {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}

/* Convert Button */
.btn-convert {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45);
}

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

.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner Loader */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress bar inside convert card */
.progress-panel {
    display: none;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.2s ease;
}

/* Ad slots */
.ad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
    min-height: 90px;
    overflow: hidden;
}

.ad-container::before {
    content: "SPONSORED";
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.ad-sidebar {
    min-height: 250px;
    margin-top: 1.5rem;
}

/* Interactive Details Section */
.details-section {
    margin-top: 2rem;
}

.details-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.details-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* FAQ block */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.faq-item h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Footer layout */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
    margin-top: auto;
    background: var(--bg-card);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-time-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

[data-theme="light"] .current-time-badge {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 8px;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary);
}
