/* static/css/tools.css */
/* Shared CSS for all PDF tool pages (merge, compress, split, batch_compress, etc.) */

:root {
    --primary: #e5322d;
    --primary-dark: #cc2b26;
    --primary-light: #fee9e7;
    --bg-light: #f8f9fa;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --border-light: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 20px rgba(0,0,0,0.03);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --info: #3b82f6;
    --indigo: #4f46e5;
    --indigo-dark: #4338ca;
    --zip: #7c3aed;
    --zip-dark: #6d28d9;
    --excel-green: #217346;
    --word-blue: #2b5797;
    --powerpoint-orange: #d24730;
}

/* Premium Badge */
.premium-badge {
    background: gold;
    color: black;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    display: inline-block;
}

/* Cost Estimator Styles */
.cost-estimator {
    background: white;
    border: 3px solid var(--primary) !important;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: block !important;
}

.cost-estimator-header {
    padding: 12px 16px;
    background: var(--primary-light);
    border-bottom: 1px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cost-estimator-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
}

.cost-estimator-header i {
    color: var(--primary);
    font-size: 18px;
}

.cost-estimator-content {
    padding: 16px;
    background: white;
    min-height: 80px;
}

.loading-estimate {
    text-align: center;
    padding: 16px;
    color: var(--text-light);
}

.estimate-free {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimate-cost {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
}

.estimate-cost .cost-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin: 8px 0;
}

.cost-breakdown {
    font-size: 12px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    color: #666;
}

.estimate-premium {
    background: #cce5ff;
    color: #004085;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimate-insufficient {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
}

.estimate-insufficient .upgrade-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.balance-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.balance-info .balance-value {
    font-weight: 600;
    color: var(--primary);
}

.balance-info .balance-value.insufficient {
    color: #dc3545;
}

/* Ad Container */
.ad-container {
    background: #f9f9f9;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.ad-header {
    max-width: 728px;
    margin: 0 auto 20px;
}

.ad-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ad-section {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 clamp(16px, 3vw, 24px);
    width: 100%;
}



/* Download Screen */
.download-screen {
    display: none;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    padding: 20px;
    margin: 20px auto 40px auto;
    border: 1px solid #e2e8f0;
    max-width: 1400px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
}

.download-screen.visible {
    display: block;
}

.download-split-layout {
    display: flex;
    gap: 24px;
    width: 100%;
}

.download-left-panel {
    flex: 1.22;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.download-right-panel {
    flex: 1;
    max-width: 45%;
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.download-left-panel > * {
    width: 100%;
}

.download-header {
    text-align: left;
}

.download-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 5px;
    text-align: left;
}

.download-header p {
    color: #64748b;
    font-size: 13px;
    text-align: left;
}

.progress-section {
    width: 100%;
}

.progress-status {
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: left;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

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

.progress-percentage {
    text-align: left;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 8px;
}

.grey-separator {
    width: 100%;
    height: 40px;
    background: #e2e8f0;
    border-radius: 8px;
    margin: 0;
}

.download-right-panel > * {
    width: 100%;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.success-message.visible {
    display: flex;
}

.success-message svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.file-info-panel {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.file-info-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-info-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.file-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.file-info-item:last-child {
    border-bottom: none;
}

.file-info-label {
    color: #64748b;
}

.file-info-value {
    font-weight: 600;
    color: #0f172a;
}

.privacy-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 12px;
    color: #0369a1;
    display: flex;
    gap: 12px;
    line-height: 1.5;
}

.privacy-note svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.privacy-note strong {
    color: #0f172a;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}

.expiry-timer {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.expiry-timer svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.expiry-timer span {
    font-weight: 600;
}

.download-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}

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

.new-tool-btn {
    background: var(--indigo);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.new-tool-btn:hover {
    background: var(--indigo-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.4);
}

.new-tool-btn svg {
    width: 18px;
    height: 18px;
}

/* Main container */
.main-container {
    flex: 1;
    overflow: visible;
    padding: clamp(12px, 2vh, 20px) clamp(12px, 2vw, 20px);
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    transition: all 0.3s ease;
    min-height: auto;
    margin-bottom: 20px;
}

.main-container.single-column {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.main-container.single-column .files-section {
    max-width: min(1200px, 95%);
    width: 100%;
    margin: 0 auto;
}

.main-container.split-layout {
    display: flex;
    gap: clamp(16px, 2vw, 24px);
    min-height: 600px;
    height: auto;
    margin-bottom: 20px;
    align-items: flex-start;
}

.main-container.split-layout .files-section {
    flex: 2;
    min-width: 0;
}

.main-container.split-layout .controls-section {
    flex: 1;
    min-width: 340px;
    max-width: 400px;
    display: flex;
    position: sticky;
    top: 20px;
}

/* Files Section */
.files-section {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    padding: clamp(15px, 2vh, 20px);
    overflow: visible;
    height: auto;
    min-height: 400px;
    transition: all 0.3s ease;
    border: 1px solid #edf2f7;
    margin-bottom: 20px;
}

.files-header {
    margin-bottom: clamp(16px, 2vh, 20px);
    flex-shrink: 0;
}

.files-header h2 {
    margin: 0 0 clamp(4px, 0.8vh, 8px) 0;
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.slogan {
    font-size: clamp(13px, 1.8vw, 15px);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.slogan svg {
    color: var(--primary);
    opacity: 0.7;
    width: clamp(14px, 1.8vw, 18px);
    height: clamp(14px, 1.8vw, 18px);
}

.file-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: clamp(8px, 1.5vh, 12px);
}

.file-count {
    background: #eef2f6;
    padding: clamp(4px, 0.8vh, 6px) clamp(10px, 1.5vw, 14px);
    border-radius: 30px;
    font-size: clamp(12px, 1.5vw, 14px);
    color: #4a5568;
    font-weight: 500;
}

/* Upload Box */
.upload-box {
    background: linear-gradient(145deg, #fafcff, #f8fafc);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: clamp(20px, 3vh, 36px) clamp(16px, 2vw, 24px);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: clamp(20px, 2.5vh, 28px);
    text-align: center;
    flex-shrink: 0;
}

.upload-box:hover {
    border-color: var(--primary);
    background: #fff5f5;
}

.upload-box.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}

.upload-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: clamp(12px, 2vh, 16px) clamp(24px, 4vw, 36px);
    font-size: clamp(16px, 2.2vw, 18px);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(229, 50, 45, 0.25);
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(229, 50, 45, 0.35);
}

.upload-btn svg {
    width: clamp(16px, 2.2vw, 20px);
    height: clamp(16px, 2.2vw, 20px);
}

.drop-text {
    margin-top: clamp(12px, 2vh, 16px);
    font-size: clamp(13px, 1.8vw, 15px);
    color: #64748b;
}

.drop-text strong {
    color: var(--primary);
    font-weight: 600;
}

/* Files Grid */
.files-grid-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-right: -8px;
    min-height: 200px;
    max-height: 500px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
    gap: clamp(12px, 1.5vw, 16px);
    padding: 4px 0;
}

.card {
    background: white;
    border: 1px solid #e9eef2;
    border-radius: 12px;
    padding: clamp(10px, 1.5vh, 14px);
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s;
    position: relative;
    user-select: none;
    width: 100%;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 20px rgba(229, 50, 45, 0.12);
    transform: translateY(-2px);
}

.card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1.4;
    object-fit: cover;
    border-radius: 8px;
    background: #f1f5f9;
    pointer-events: none;
    border: 1px solid #e2e8f0;
}

.file-info {
    margin-top: clamp(6px, 1vh, 10px);
    width: 100%;
}

.filename {
    font-size: clamp(11px, 1.5vw, 13px);
    color: #334155;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    width: 100%;
}

.page-count {
    font-size: clamp(10px, 1.3vw, 11px);
    color: #64748b;
    margin-top: 2px;
}

.remove {
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--primary);
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    line-height: 1;
    width: clamp(24px, 4vw, 30px);
    height: clamp(24px, 4vw, 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card:hover .remove {
    opacity: 1;
}

.remove:hover {
    background: #fee2e2;
    border-color: var(--primary);
}

/* Controls Section */
.controls-section {
    display: none;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    padding: clamp(20px, 2.5vh, 28px);
    flex-direction: column;
    height: auto;
    overflow-y: auto;
    overflow-x: visible;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid #edf2f7;
    min-width: 340px;
}

.controls-section.visible {
    display: flex !important;
    opacity: 1;
    transform: translateX(0);
}

/* Hide controls when download screen is visible */
.download-screen.visible ~ .controls-section,
.download-screen.visible + .controls-section {
    display: none !important;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.controls-header {
    flex-shrink: 0;
}

.controls-header h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.controls-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.cost-estimator {
    flex-shrink: 0;
    margin-bottom: 0;
}

.option-group {
    background: #f8fafc;
    border-radius: 12px;
    padding: 18px;
}

.option-group h3 {
    margin: 0 0 14px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group h3 svg {
    width: 18px;
    height: 18px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.option-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin: 0;
}

.option-item input[type="radio"]:checked + label {
    color: var(--primary);
    font-weight: 600;
}

.option-item label {
    flex: 1;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.option-description {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 30px;
    margin-top: -8px;
    margin-bottom: 12px;
}

/* Button Container */
.tool-btn-container {
    flex-shrink: 0;
    margin: 20px 0;
}

.tool-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(229, 50, 45, 0.3);
}

.tool-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(229, 50, 45, 0.4);
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tool-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.tool-btn:hover svg {
    transform: translateX(4px);
}

/* File List */
.file-list {
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
    margin: 0;
    background: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

.file-list-item {
    font-size: 13px;
    padding: 6px 8px;
    border-bottom: 1px solid #edf2f7;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-list-item:last-child {
    border-bottom: none;
}

.file-list-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Privacy Note */
.privacy-note {
    flex-shrink: 0;
    margin-top: auto;
}

/* Error Message */
.error-message {
    flex-shrink: 0;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px;
    border-radius: 12px;
    display: none;
    font-size: 14px;
    align-items: center;
    gap: 10px;
}

.error-message.active {
    display: flex;
}

.error-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Message Panel */
.message-panel {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 20px 24px;
    text-align: center;
    max-width: 800px;
    width: 90%;
    margin: 16px auto 24px auto;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(229, 50, 45, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.message-panel svg {
    opacity: 0.8;
    color: var(--primary);
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
}

.message-panel h3 {
    color: #0f172a;
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.message-panel p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
    max-width: 350px;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    font-size: 18px;
    color: #0f172a;
    margin-top: 24px;
}

.loading-overlay p:last-of-type {
    font-size: 14px;
    color: #64748b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-close:hover {
    color: var(--primary);
}

.credit-error, .upgrade-error {
    text-align: center;
}

.credit-error h3, .upgrade-error h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
}

.packages-list {
    margin: 20px 0;
    text-align: left;
}

.package-option {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.package-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn {
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8f9fa;
}



@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .button-group {
        flex-direction: column;
    }
}

/* Compression-specific styles */
.savings-badge {
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.zip-badge {
    background: var(--zip);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.compression-level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.compression-low {
    background: #d4edda;
    color: #155724;
}

.compression-medium {
    background: #fff3cd;
    color: #856404;
}

.compression-high {
    background: #f8d7da;
    color: #721c24;
}

.compression-max {
    background: #cce5ff;
    color: #004085;
}

/* ============================================
   SPLIT TOOL SPECIFIC STYLES
   ============================================ */

/* Mode options (radio buttons with labels) */
.mode-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin: 0;
}

.mode-option label {
    flex: 1;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Mode descriptions */
.mode-description {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 30px;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Split input groups */
.split-input-group {
    margin-left: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.split-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.split-input-group input[type="text"],
.split-input-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

.split-input-group input[type="text"]:focus,
.split-input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.split-input-group input[type="number"] {
    width: 120px;
}

.split-input-group .help-text {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
}

.split-input-group .help-text i {
    color: var(--primary);
    margin-right: 4px;
}

.split-results-list {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius-md);
    padding: 10px;
    border: 1px solid var(--border-light);
    margin-top: 12px;
}

.split-result-item {
    font-size: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.split-result-item:last-child {
    border-bottom: none;
}

.split-result-name {
    flex: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
    font-weight: 500;
}

.split-result-pages {
    flex: 1;
    text-align: right;
    font-weight: 600;
    color: var(--info);
    font-size: 11px;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    width: auto;
}

/* Cost estimator in files section - keep compact */
.files-section .cost-estimator {
    margin: 16px 0 20px 0;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
    max-width: 400px;  /* Keep it narrow like controls */
}

.files-section .cost-estimator .cost-estimator-header {
    background: var(--primary-light);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-light);
}

.files-section .cost-estimator .cost-estimator-content {
    padding: 12px 16px;
}

.files-section .cost-estimator .cost-estimator-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Make sure file-stats stays on same line */
.files-header {
    display: block;
}

.file-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive: on mobile, cost estimator can be full width */
@media (max-width: 768px) {
    .files-section .cost-estimator {
        max-width: 100%;
    }
}

/* ============================================
   RELATED TOOLS SECTION
   ============================================ */
.related-tools-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--border-light);
}

.related-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.related-tools-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.related-tools-header h3 i {
    color: var(--primary);
    margin-right: 8px;
}

.view-all-tools {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.view-all-tools:hover {
    text-decoration: underline;
    gap: 8px;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.2s;
}

.related-tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.related-tool-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.related-tool-info {
    flex: 1;
    min-width: 0;
}

.related-tool-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-tool-desc {
    font-size: 11px;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   VIDEO AD - INCREASED GAP, BUTTONS LOWER
   ============================================ */

.download-left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

.video-ad-container {
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 12px;
    color: white;
    width: 100%;
    box-sizing: border-box;
    height: 380px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.video-ad-container .ad-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.video-ad-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100% - 30px);
    position: relative;
}

.video-player {
    width: 100%;
    height: 78%; 
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
    background: #000;
}

/* ============================================
   CONTROLS: Lower to the edge
   ============================================ */

.video-controls {
    position: absolute;
    bottom: 6px;        /* 🔑 MOVED DOWN (was 8px) */
    left: 15px;         
    transform: none;    
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;          
    padding: 8px 12px;  
    background: rgba(0,0,0,0.75);
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 10;
    backdrop-filter: blur(4px);
}

.video-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 28px;        
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.video-control-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.video-control-btn svg {
    width: 14px;        
    height: 14px;
    fill: white;
}

/* PROGRESS BAR: Raised higher to create distance */
.video-progress {
    position: absolute;
    bottom: 60px;       /* 🔑 MOVED UP (was 52px) */
    left: 10%;
    right: 10%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    cursor: pointer;
}

.video-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* TIMER: Hidden */
.video-timer {
    display: none;
}

/* AD NOTE */
.video-ad-note {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 10px;
    color: #999;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
}

.video-ad-note svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}


/* Optimize is retired (see credit_middleware) — post-processing breaks PDF/A.
   Hides the whole option group: heading, checkbox, label and description. */
.option-group:has(#optimizeCheckbox) {
    display: none !important;
}


@media (max-width: 768px) {
    .video-ad-container { height: 320px; }
    .video-controls { bottom: 4px; left: 10px; }
    .video-control-btn { width: 24px; height: 24px; }
    .video-progress { bottom: 55px; left: 5%; right: 5%; }
}

/* ============================================
   End video styles
   ============================================ */


@media (max-width: 768px) {
    .related-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .related-tool-card {
        padding: 10px 12px;
    }
    .related-tool-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
    .related-tools-header {
        flex-direction: column;
        text-align: center;
    }
}
