/* ==========================================================================
   CarePDF Tool Pages - Unique, Simple, User-Friendly Design
   External CSS for all PDF tools
   ========================================================================== */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --tool-primary: #e74c3c;
    --tool-primary-dark: #c0392b;
    --tool-primary-light: #fadbd8;
    --tool-success: #27ae60;
    --tool-success-light: #d5f5e3;
    --tool-warning: #f39c12;
    --tool-warning-light: #fef9e7;
    --tool-info: #3498db;
    --tool-info-light: #ebf5fb;
    --tool-gray-50: #f8f9fa;
    --tool-gray-100: #f1f3f5;
    --tool-gray-200: #e9ecef;
    --tool-gray-300: #dee2e6;
    --tool-gray-400: #ced4da;
    --tool-gray-500: #adb5bd;
    --tool-gray-600: #868e96;
    --tool-gray-700: #495057;
    --tool-gray-800: #343a40;
    --tool-gray-900: #212529;
    --tool-radius: 12px;
    --tool-radius-lg: 16px;
    --tool-radius-xl: 20px;
    --tool-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --tool-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --tool-transition: 0.2s ease;
}

/* ==========================================================================
   1. Page Layout
   ========================================================================== */
.tool-page {
    min-height: 100vh;
    padding-top: 70px;
    background: var(--tool-gray-50);
}

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* ==========================================================================
   2. Tool Header - Clean & Minimal
   ========================================================================== */
.tool-header {
    text-align: center;
    padding: 48px 20px 40px;
    background: linear-gradient(180deg, #fff 0%, var(--tool-gray-50) 100%);
}

.tool-header-inner {
    max-width: 700px;
    margin: 0 auto;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--tool-primary-light);
    color: var(--tool-primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-badge svg {
    width: 14px;
    height: 14px;
}

.tool-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--tool-gray-900);
    margin: 0 0 12px;
    line-height: 1.2;
}

.tool-subtitle {
    font-size: 1.125rem;
    color: var(--tool-gray-600);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   3. Upload Zone - Simple & Clean
   ========================================================================== */
.upload-section {
    margin-bottom: 32px;
}

.upload-zone {
    background: #fff;
    border: 2px dashed var(--tool-gray-300);
    border-radius: var(--tool-radius-lg);
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--tool-transition);
    position: relative;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--tool-primary);
    background: #fff;
}

.upload-zone.dragover {
    border-color: var(--tool-primary);
    border-style: solid;
    background: var(--tool-primary-light);
    transform: scale(1.01);
}

.upload-zone.has-files {
    padding: 24px;
    min-height: auto;
    border-style: solid;
    border-color: var(--tool-gray-200);
    cursor: default;
}

.upload-zone.has-files:hover {
    border-color: var(--tool-gray-200);
    transform: none;
}

/* Upload Content */
.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-zone.has-files .upload-content {
    display: none;
}

/* Upload Icon */
.upload-icon-wrapper {
    width: 52px;
    height: 52px;
    background: var(--tool-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tool-transition);
}

.upload-zone:hover .upload-icon-wrapper {
    transform: scale(1.05);
    background: var(--tool-primary);
}

.upload-zone.dragover .upload-icon-wrapper {
    transform: scale(1.1);
    background: var(--tool-primary);
}

.upload-icon-wrapper svg {
    width: 28px;
    height: 28px;
    color: var(--tool-primary);
    transition: color var(--tool-transition);
}

.upload-zone:hover .upload-icon-wrapper svg,
.upload-zone.dragover .upload-icon-wrapper svg {
    color: #fff;
}

/* Upload Text */
.upload-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tool-gray-800);
    margin: 0 0 8px;
}

.upload-text p {
    font-size: 0.9375rem;
    color: var(--tool-gray-500);
    margin: 0;
}

/* Upload Button */
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--tool-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--tool-radius);
    cursor: pointer;
    transition: all var(--tool-transition);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.upload-btn:hover {
    background: var(--tool-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

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

/* File Formats */
.upload-formats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.format-tag {
    padding: 4px 12px;
    background: var(--tool-gray-100);
    color: var(--tool-gray-600);
    font-size: 11px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}

/* ==========================================================================
   4. File List Grid
   ========================================================================== */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    width: 100%;
}

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

.upload-content.hidden {
    display: none !important;
}

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

/* ==========================================================================
   5. File Card - Clean Design
   ========================================================================== */
.file-card {
    position: relative;
    background: var(--tool-gray-50);
    border: 1px solid var(--tool-gray-200);
    border-radius: var(--tool-radius);
    padding: 12px;
    cursor: grab;
    transition: all var(--tool-transition);
    user-select: none;
}

.file-card:hover {
    border-color: var(--tool-gray-300);
    box-shadow: var(--tool-shadow);
}

.file-card:active {
    cursor: grabbing;
}

/* File Number */
.file-num {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    background: var(--tool-gray-800);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* File Delete Button */
.file-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--tool-transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 10;
}

.file-card:hover .file-delete {
    opacity: 1;
}

.file-delete svg {
    width: 14px;
    height: 14px;
    color: var(--tool-gray-500);
}

.file-delete:hover {
    background: #e74c3c;
}

.file-delete:hover svg {
    color: #fff;
}

/* File Thumbnail */
.file-thumb {
    width: 100%;
    aspect-ratio: 3/4;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-thumb-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--tool-gray-400);
}

.file-thumb-placeholder svg {
    width: 32px;
    height: 32px;
}

.file-thumb-placeholder span {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    background: var(--tool-primary);
    color: #fff;
    border-radius: 4px;
}

/* File Info */
.file-info {
    text-align: center;
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--tool-gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-pages {
    font-size: 11px;
    color: var(--tool-gray-500);
    margin-top: 2px;
}

/* ==========================================================================
   6. Add More Card
   ========================================================================== */
.add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 2px dashed var(--tool-gray-300);
    border-radius: var(--tool-radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--tool-transition);
    min-height: 120px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.add-card:hover,
.add-card:active {
    border-color: var(--tool-primary);
    background: var(--tool-primary-light);
}

.add-card:active {
    transform: scale(0.98);
}

.add-card-icon {
    width: 40px;
    height: 40px;
    background: var(--tool-gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tool-transition);
}

.add-card:hover .add-card-icon {
    background: var(--tool-primary);
}

.add-card-icon svg {
    width: 20px;
    height: 20px;
    color: var(--tool-gray-500);
    transition: color var(--tool-transition);
}

.add-card:hover .add-card-icon svg {
    color: #fff;
}

.add-card span {
    font-size: 12px;
    font-weight: 500;
    color: var(--tool-gray-500);
}

.add-card:hover span {
    color: var(--tool-primary);
}

/* ==========================================================================
   7. Sortable States
   ========================================================================== */
.file-card.sortable-ghost {
    opacity: 0.3;
    border: 2px dashed var(--tool-primary);
    background: var(--tool-primary-light);
    transform: scale(0.98);
}

.file-card.sortable-chosen {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 100;
    transform: scale(1.02);
    border-color: var(--tool-primary);
}

.file-card.sortable-drag {
    opacity: 0;
}

.file-card.sortable-fallback {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(1.05) rotate(2deg);
    border: 2px solid var(--tool-primary);
    background: #fff;
    opacity: 0.95;
}

/* Body state during sorting */
body.is-sorting {
    cursor: grabbing !important;
    user-select: none;
}

body.is-sorting * {
    cursor: grabbing !important;
}

body.is-sorting .file-card {
    transition: transform 0.2s ease;
}

/* ==========================================================================
   8. Tool Options Panel
   ========================================================================== */
.options-panel {
    background: #fff;
    border: 1px solid var(--tool-gray-200);
    border-radius: var(--tool-radius-lg);
    margin-top: 24px;
    overflow: hidden;
    display: none;
}

.options-panel.visible {
    display: block;
}

.options-header {
    padding: 16px 20px;
    background: var(--tool-gray-50);
    border-bottom: 1px solid var(--tool-gray-200);
}

.options-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--tool-gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-header h4 svg {
    width: 18px;
    height: 18px;
    color: var(--tool-gray-500);
}

.options-body {
    padding: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tool-gray-700);
}

.form-select,
.form-input {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--tool-gray-300);
    border-radius: 8px;
    background: #fff;
    color: var(--tool-gray-800);
    transition: border-color var(--tool-transition);
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--tool-primary);
}

.form-select:disabled {
    background: var(--tool-gray-100);
    cursor: not-allowed;
}

/* ==========================================================================
   9. Process Action Bar
   ========================================================================== */
.action-bar {
    background: #fff;
    border: 1px solid var(--tool-gray-200);
    border-radius: var(--tool-radius-lg);
    padding: 20px 24px;
    margin-top: 24px;
    display: none;
}

.action-bar.visible {
    display: block;
}

.action-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.action-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-count {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--tool-gray-900);
}

.action-hint {
    font-size: 13px;
    color: var(--tool-gray-500);
}

.process-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--tool-primary) 0%, var(--tool-primary-dark) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--tool-radius);
    cursor: pointer;
    transition: all var(--tool-transition);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    min-width: 180px;
    justify-content: center;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

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

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

/* Process Button Loading State */
.process-btn.loading {
    pointer-events: none;
    opacity: 0.9;
}

.process-btn.loading svg {
    display: none;
}

.process-btn.loading span {
    display: none;
}

.process-btn.loading::after {
    content: '';
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   10. Info Tip Box
   ========================================================================== */
.tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--tool-info-light);
    border-radius: var(--tool-radius);
    margin-top: 16px;
}

.tip-box-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-box-icon svg {
    width: 18px;
    height: 18px;
    color: var(--tool-info);
}

.tip-box p {
    margin: 0;
    font-size: 13px;
    color: #1a5276;
    line-height: 1.5;
}

.tip-box strong {
    color: #154360;
}

/* ==========================================================================
   11. Validation Message
   ========================================================================== */
.validation-msg {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--tool-radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.validation-msg.error {
    display: flex;
    background: #fdedec;
    border: 1px solid #f5b7b1;
    color: #c0392b;
}

.validation-msg.warning {
    display: flex;
    background: var(--tool-warning-light);
    border: 1px solid #f9e79f;
    color: #9a7d0a;
}

.validation-msg svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   12. File Limits Info
   ========================================================================== */
.limits-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--tool-gray-50);
    border-radius: 8px;
    margin-top: 16px;
}

.limit-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--tool-gray-600);
}

.limit-item svg {
    width: 14px;
    height: 14px;
    color: var(--tool-gray-400);
}

/* ==========================================================================
   13. How It Works Section
   ========================================================================== */
.how-section {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--tool-gray-200);
}

.how-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tool-gray-900);
    text-align: center;
    margin: 0 0 32px;
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step-item {
    text-align: center;
    padding: 24px 16px;
    background: #fff;
    border-radius: var(--tool-radius-lg);
    transition: all var(--tool-transition);
}

.step-item:hover {
    box-shadow: var(--tool-shadow);
    transform: translateY(-4px);
}

.step-num {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--tool-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-num svg {
    width: 24px;
    height: 24px;
    color: var(--tool-primary);
}

.step-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tool-gray-800);
    margin: 0 0 8px;
}

.step-item p {
    font-size: 14px;
    color: var(--tool-gray-600);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   14. Features Section
   ========================================================================== */
.features-section {
    margin-top: 48px;
}

.features-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tool-gray-900);
    text-align: center;
    margin: 0 0 32px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: var(--tool-radius);
    transition: all var(--tool-transition);
}

.feature-card:hover {
    box-shadow: var(--tool-shadow);
}

.feature-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--tool-primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    color: var(--tool-primary);
}

.feature-text h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--tool-gray-800);
    margin: 0 0 6px;
}

.feature-text p {
    font-size: 13px;
    color: var(--tool-gray-600);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   15. FAQ Section
   ========================================================================== */
.faq-section {
    margin-top: 48px;
}

.faq-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tool-gray-900);
    text-align: center;
    margin: 0 0 32px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: #fff;
    border-radius: var(--tool-radius);
    overflow: hidden;
}

.faq-item details {
    border: 1px solid var(--tool-gray-200);
    border-radius: var(--tool-radius);
}

.faq-item details[open] {
    border-color: var(--tool-primary);
}

.faq-item summary {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--tool-gray-800);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: var(--tool-gray-400);
    transition: transform var(--tool-transition);
}

.faq-item details[open] summary::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px 16px;
    font-size: 14px;
    color: var(--tool-gray-600);
    line-height: 1.6;
}

/* ==========================================================================
   16. Related Tools
   ========================================================================== */
.related-section {
    margin-top: 48px;
}

.related-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tool-gray-900);
    text-align: center;
    margin: 0 0 32px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: #fff;
    border: 1px solid var(--tool-gray-200);
    border-radius: var(--tool-radius);
    text-decoration: none;
    transition: all var(--tool-transition);
}

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

.related-card-icon {
    width: 48px;
    height: 48px;
    background: var(--tool-gray-100);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tool-transition);
}

.related-card:hover .related-card-icon {
    background: var(--tool-primary-light);
}

.related-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--tool-gray-500);
    transition: color var(--tool-transition);
}

.related-card:hover .related-card-icon svg {
    color: var(--tool-primary);
}

.related-card span {
    font-size: 13px;
    font-weight: 500;
    color: var(--tool-gray-700);
    text-align: center;
}

/* ==========================================================================
   17. Processing Modal
   ========================================================================== */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

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

.processing-modal {
    background: #fff;
    border-radius: var(--tool-radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--tool-shadow-lg);
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--tool-gray-200);
    border-top-color: var(--tool-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

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

.processing-modal h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tool-gray-800);
    margin: 0 0 8px;
}

.processing-modal p {
    font-size: 14px;
    color: var(--tool-gray-500);
    margin: 0;
}

/* ==========================================================================
   18. Notifications
   ========================================================================== */
.notification-wrap,
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 40px);
}

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: var(--tool-radius);
    box-shadow: var(--tool-shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
}

.notification.hiding {
    animation: slideOut 0.2s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.notification.success { border-left: 4px solid var(--tool-success); }
.notification.error { border-left: 4px solid #e74c3c; }
.notification.warning { border-left: 4px solid var(--tool-warning); }
.notification.info { border-left: 4px solid var(--tool-info); }

.notification-text {
    flex: 1;
    font-size: 14px;
    color: var(--tool-gray-700);
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--tool-gray-400);
    cursor: pointer;
    padding: 4px;
}

/* ==========================================================================
   19. Responsive - Tablet
   ========================================================================== */
@media (max-width: 768px) {
    .tool-container {
        padding: 24px 16px 48px;
    }

    .tool-header {
        padding: 32px 16px;
    }

    .tool-title {
        font-size: 1.75rem;
    }

    .tool-subtitle {
        font-size: 1rem;
    }

    .upload-zone {
        padding: 24px 16px;
        min-height: auto;
    }

    .upload-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .upload-icon-wrapper svg {
        width: 22px;
        height: 22px;
    }

    .upload-text h3 {
        font-size: 1.125rem;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }

    .file-card {
        padding: 10px;
    }

    .file-thumb {
        aspect-ratio: 4/5;
        margin-bottom: 8px;
    }

    .file-delete {
        opacity: 1;
    }

    .action-inner {
        flex-direction: column;
        text-align: center;
    }

    .process-btn {
        width: 100%;
    }

    .steps-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .limits-bar {
        flex-direction: column;
        gap: 8px;
    }
}

/* ==========================================================================
   20. Responsive - Mobile
   ========================================================================== */
@media (max-width: 480px) {
    .tool-header {
        padding: 24px 12px;
    }

    .tool-title {
        font-size: 1.5rem;
    }

    .tool-badge {
        font-size: 10px;
        padding: 5px 10px;
    }

    .upload-zone {
        padding: 20px 12px;
        min-height: auto;
        border-radius: var(--tool-radius);
    }

    .upload-icon-wrapper {
        width: 40px;
        height: 40px;
    }

    .upload-icon-wrapper svg {
        width: 18px;
        height: 18px;
    }

    .upload-btn {
        width: 100%;
        padding: 12px 24px;
    }

    .file-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .file-card {
        padding: 10px;
        border-radius: 10px;
    }

    .file-thumb {
        aspect-ratio: 1/1;
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .file-num {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: 6px;
        left: 6px;
    }

    .file-delete {
        width: 26px;
        height: 26px;
        top: 6px;
        right: 6px;
        opacity: 1;
    }

    .file-delete svg {
        width: 12px;
        height: 12px;
    }

    .file-name {
        font-size: 11px;
        line-height: 1.3;
    }

    .file-pages {
        font-size: 10px;
    }

    .file-thumb-placeholder svg {
        width: 24px;
        height: 24px;
    }

    .file-thumb-placeholder span {
        font-size: 9px;
        padding: 2px 6px;
    }

    .add-card {
        min-height: 100px;
        padding: 12px;
        gap: 6px;
    }

    .add-card-icon {
        width: 32px;
        height: 32px;
    }

    .add-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .add-card span {
        font-size: 11px;
    }

    .action-bar {
        position: sticky;
        bottom: 0;
        margin: 16px -16px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .step-item {
        padding: 20px 12px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .notification-wrap,
    .notification-container {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
}

/* ==========================================================================
   21. Touch Device
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    .upload-zone:hover {
        border-color: var(--tool-gray-300);
    }

    .upload-zone:hover .upload-icon-wrapper {
        transform: none;
        background: var(--tool-primary-light);
    }

    .upload-zone:hover .upload-icon-wrapper svg {
        color: var(--tool-primary);
    }

    .file-card {
        cursor: default;
        touch-action: manipulation;
        -webkit-touch-callout: none;
    }

    .file-card:hover {
        box-shadow: none;
    }

    .file-card:active {
        transform: scale(0.98);
    }

    /* Better sortable on touch */
    .file-card.sortable-chosen {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(0,0,0,0.2);
        z-index: 1000;
    }

    .file-card.sortable-fallback {
        transform: scale(1.08) rotate(1deg);
        box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    }

    .file-grid {
        touch-action: pan-y;
    }

    body.is-sorting .file-grid {
        touch-action: none;
    }

    .file-delete {
        opacity: 1;
        width: 28px;
        height: 28px;
        background: rgba(255,255,255,0.9);
    }

    .file-delete svg {
        width: 14px;
        height: 14px;
    }

    .upload-btn,
    .process-btn {
        min-height: 48px;
    }

    /* Smooth drag hint */
    .file-card::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        transition: box-shadow 0.2s ease;
    }

    .file-card.sortable-chosen::after {
        box-shadow: inset 0 0 0 2px var(--tool-primary);
    }
}

/* ==========================================================================
   22. Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   23. Tool Page Sidebar Layout
   ========================================================================== */
.tool-layout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.tool-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.tool-main {
    min-width: 0;
}

.tool-main .tool-container {
    max-width: none;
    padding: 40px 0 20px;
}

.tool-full-width {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 60px;
}

/* ==========================================================================
   24. Tool Sidebar Styles
   ========================================================================== */
.tool-sidebar {
    padding-top: 40px;
}

.sidebar-sticky {
    position: sticky;
    top: calc(var(--header-height, 80px) + 20px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: #fff;
    border: 1px solid var(--tool-gray-200);
    border-radius: var(--tool-radius-lg);
    padding: 20px;
    transition: box-shadow var(--tool-transition);
}

.sidebar-widget:hover {
    box-shadow: var(--tool-shadow);
}

.sidebar-widget h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--tool-gray-800);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tool-gray-100);
}

/* Ad Widget */
.ad-widget {
    text-align: center;
}

.ad-widget .ad-label {
    display: block;
    font-size: 10px;
    color: var(--tool-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Tools Widget Links */
.widget-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.widget-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--tool-gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--tool-transition);
}

.widget-links li a:hover {
    background: var(--tool-primary-light);
    color: var(--tool-primary);
}

.widget-links .w-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--tool-gray-100);
    border-radius: 8px;
    flex-shrink: 0;
    transition: all var(--tool-transition);
}

.widget-links li a:hover .w-icon {
    background: var(--tool-primary);
}

.widget-links .w-icon svg {
    width: 16px;
    height: 16px;
    color: var(--tool-gray-500);
    transition: color var(--tool-transition);
}

.widget-links li a:hover .w-icon svg {
    color: #fff;
}

/* Tips Widget */
.tips-widget .tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tips-widget .tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--tool-gray-600);
    line-height: 1.4;
}

.tips-widget .tips-list li svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--tool-success);
    margin-top: 1px;
}

/* ==========================================================================
   25. Sidebar Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .tool-layout {
        grid-template-columns: 1fr 280px;
        gap: 30px;
    }
}

@media (max-width: 991px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        display: none;
    }

    .tool-layout-container {
        padding: 0 16px;
    }

    .tool-main .tool-container {
        padding: 24px 0 16px;
    }

    .tool-full-width {
        padding: 0 0 48px;
    }
}

@media (max-width: 768px) {
    .tool-layout-container {
        padding: 0 12px;
    }
}

/* ==========================================================================
   26. Dark Mode Support - Complete
   ========================================================================== */

/* Tool Page Base */
[data-theme="dark"] .tool-page {
    background: #0f0f14;
}

/* Tool Header */
[data-theme="dark"] .tool-header {
    background: linear-gradient(180deg, #1a1a24 0%, #0f0f14 100%);
}

[data-theme="dark"] .tool-title {
    color: #f3f4f6;
}

[data-theme="dark"] .tool-subtitle {
    color: #9ca3af;
}

[data-theme="dark"] .tool-badge {
    background: rgba(231, 76, 60, 0.2);
}

/* Upload Zone */
[data-theme="dark"] .upload-zone {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .upload-zone:hover {
    border-color: var(--tool-primary);
    background: #1f1f2a;
}

[data-theme="dark"] .upload-zone.dragover {
    background: rgba(231, 76, 60, 0.1);
}

[data-theme="dark"] .upload-zone.has-files {
    border-color: #3d3d4a;
}

[data-theme="dark"] .upload-text h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .upload-text p {
    color: #9ca3af;
}

[data-theme="dark"] .upload-icon-wrapper {
    background: rgba(231, 76, 60, 0.2);
}

[data-theme="dark"] .format-tag {
    background: #2d2d3a;
    color: #9ca3af;
}

/* File Cards */
[data-theme="dark"] .file-card {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .file-card:hover {
    border-color: #4d4d5a;
}

[data-theme="dark"] .file-thumb {
    background: #0f0f14;
}

[data-theme="dark"] .file-name {
    color: #e5e7eb;
}

[data-theme="dark"] .file-pages {
    color: #9ca3af;
}

[data-theme="dark"] .file-delete {
    background: #2d2d3a;
}

[data-theme="dark"] .file-delete svg {
    color: #9ca3af;
}

/* Add Card */
[data-theme="dark"] .add-card {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .add-card:hover {
    border-color: var(--tool-primary);
    background: rgba(231, 76, 60, 0.1);
}

[data-theme="dark"] .add-card-icon {
    background: #2d2d3a;
}

[data-theme="dark"] .add-card span {
    color: #9ca3af;
}

/* Options Panel */
[data-theme="dark"] .options-panel {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .options-header {
    background: #0f0f14;
    border-bottom-color: #3d3d4a;
}

[data-theme="dark"] .options-header h4 {
    color: #f3f4f6;
}

[data-theme="dark"] .form-label {
    color: #d1d5db;
}

[data-theme="dark"] .form-select,
[data-theme="dark"] .form-input {
    background: #0f0f14;
    border-color: #3d3d4a;
    color: #e5e7eb;
}

[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-input:focus {
    border-color: var(--tool-primary);
}

/* Action Bar */
[data-theme="dark"] .action-bar {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .action-count {
    color: #f3f4f6;
}

[data-theme="dark"] .action-hint {
    color: #9ca3af;
}

/* Tip Box */
[data-theme="dark"] .tip-box {
    background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .tip-box-icon {
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .tip-box p {
    color: #93c5fd;
}

[data-theme="dark"] .tip-box strong {
    color: #bfdbfe;
}

/* Validation Message */
[data-theme="dark"] .validation-msg.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .validation-msg.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* Processing Modal */
[data-theme="dark"] .processing-modal {
    background: #1a1a24;
}

[data-theme="dark"] .processing-modal h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .processing-modal p {
    color: #9ca3af;
}

[data-theme="dark"] .processing-spinner {
    border-color: #3d3d4a;
    border-top-color: var(--tool-primary);
}

/* Notifications */
[data-theme="dark"] .notification {
    background: #1a1a24;
}

[data-theme="dark"] .notification-text {
    color: #d1d5db;
}

/* Sidebar Widgets */
[data-theme="dark"] .tool-sidebar {
    background: transparent;
}

[data-theme="dark"] .sidebar-sticky {
    background: transparent;
}

[data-theme="dark"] .sidebar-widget {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .sidebar-widget h3 {
    color: #f3f4f6;
    border-bottom-color: #3d3d4a;
}

/* Tools Widget */
[data-theme="dark"] .tools-widget {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .tools-widget h3 {
    color: #f3f4f6;
}

/* Ad Widget */
[data-theme="dark"] .ad-widget {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .ad-widget .ad-label {
    color: #6b7280;
}

/* Widget Links */
[data-theme="dark"] .widget-links {
    background: transparent;
}

[data-theme="dark"] .widget-links li {
    border-bottom-color: #2d2d3a;
}

[data-theme="dark"] .widget-links li a {
    color: #d1d5db;
}

[data-theme="dark"] .widget-links li a:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #f87171;
}

[data-theme="dark"] .widget-links .w-icon,
[data-theme="dark"] .w-icon {
    background: rgba(231, 76, 60, 0.15);
}

[data-theme="dark"] .widget-links .w-icon svg,
[data-theme="dark"] .w-icon svg {
    color: #f87171;
}

/* Tips Widget */
[data-theme="dark"] .tips-widget {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .tips-widget h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .tips-widget .tips-list {
    color: #d1d5db;
}

[data-theme="dark"] .tips-widget .tips-list li {
    color: #9ca3af;
}

[data-theme="dark"] .tips-widget .tips-list li svg {
    color: #10b981;
}

/* ==========================================================================
   Info Sections Dark Mode - Complete
   ========================================================================== */

/* Full Width Container */
[data-theme="dark"] .tool-full-width {
    background: #0f0f14;
}

/* Info Section Inner */
[data-theme="dark"] .info-section-inner {
    background: #1a1a24;
    border-color: #3d3d4a;
}

/* How It Works Section */
[data-theme="dark"] .how-section {
    background: #0f0f14;
}

[data-theme="dark"] .how-section h2 {
    color: #f3f4f6;
}

[data-theme="dark"] .how-section .info-section-inner {
    background: linear-gradient(135deg, #1a1a24 0%, #0f0f14 100%);
}

[data-theme="dark"] .steps-row {
    background: transparent;
}

[data-theme="dark"] .step-item {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .step-item:hover {
    border-color: var(--primary);
    background: #1f1f2a;
}

[data-theme="dark"] .step-num {
    background: rgba(231, 76, 60, 0.15);
    color: #f87171;
}

[data-theme="dark"] .step-num svg {
    color: #f87171;
}

[data-theme="dark"] .step-item h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .step-item p {
    color: #9ca3af;
}

[data-theme="dark"] .step-connector svg {
    color: #4d4d5a;
}

/* Section Titles */
[data-theme="dark"] .section-title {
    color: #f3f4f6;
}

[data-theme="dark"] .section-subtitle {
    color: #9ca3af;
}

/* Features Section */
[data-theme="dark"] .features-section {
    background: #0f0f14;
}

[data-theme="dark"] .features-section h2 {
    color: #f3f4f6;
}

[data-theme="dark"] .features-grid {
    background: transparent;
}

[data-theme="dark"] .feature-card {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .feature-card:hover {
    background: #1f1f2a;
    border-color: #4d4d5a;
}

[data-theme="dark"] .feature-icon {
    background: rgba(231, 76, 60, 0.15);
    color: #f87171;
}

[data-theme="dark"] .feature-icon svg {
    color: #f87171;
}

[data-theme="dark"] .feature-text h4,
[data-theme="dark"] .feature-content h4 {
    color: #f3f4f6;
}

[data-theme="dark"] .feature-text p,
[data-theme="dark"] .feature-content p {
    color: #9ca3af;
}

/* FAQ Section */
[data-theme="dark"] .faq-section {
    background: #0f0f14;
}

[data-theme="dark"] .faq-section h2 {
    color: #f3f4f6;
}

[data-theme="dark"] .faq-list {
    background: transparent;
}

[data-theme="dark"] .faq-item {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .faq-item:hover {
    background: #1f1f2a;
}

[data-theme="dark"] .faq-item details {
    border-color: #3d3d4a;
    background: #1a1a24;
}

[data-theme="dark"] .faq-item details[open] {
    background: #1f1f2a;
}

[data-theme="dark"] .faq-item details summary {
    color: #f3f4f6;
}

[data-theme="dark"] .faq-item details summary:hover {
    background: rgba(231, 76, 60, 0.1);
}

[data-theme="dark"] .faq-question {
    color: #f3f4f6;
}

[data-theme="dark"] .faq-toggle {
    background: #2d2d3a;
}

[data-theme="dark"] .faq-toggle svg {
    color: #9ca3af;
}

[data-theme="dark"] .faq-answer {
    color: #9ca3af;
    border-top-color: #3d3d4a;
}

/* Related Tools Section */
[data-theme="dark"] .related-section {
    background: #0f0f14;
}

[data-theme="dark"] .related-section h2 {
    color: #f3f4f6;
}

[data-theme="dark"] .related-grid {
    background: transparent;
}

[data-theme="dark"] .related-card {
    background: #1a1a24;
    border-color: #3d3d4a;
}

[data-theme="dark"] .related-card:hover {
    background: #1f1f2a;
    border-color: var(--primary);
}

[data-theme="dark"] .related-card span {
    color: #d1d5db;
}

[data-theme="dark"] .related-card:hover span {
    color: #f3f4f6;
}

[data-theme="dark"] .related-card-icon,
[data-theme="dark"] .related-icon {
    background: rgba(231, 76, 60, 0.15);
    border-color: #3d3d4a;
}

[data-theme="dark"] .related-card-icon svg,
[data-theme="dark"] .related-icon svg {
    color: #f87171;
}

[data-theme="dark"] .related-card:hover .related-card-icon,
[data-theme="dark"] .related-card:hover .related-icon {
    background: var(--primary);
}

[data-theme="dark"] .related-card:hover .related-card-icon svg,
[data-theme="dark"] .related-card:hover .related-icon svg {
    color: #fff;
}

[data-theme="dark"] .related-name {
    color: #d1d5db;
}

/* ==========================================================================
   27. RTL Support
   ========================================================================== */
[dir="rtl"] .widget-links li a {
    flex-direction: row-reverse;
}

[dir="rtl"] .tips-widget .tips-list li {
    flex-direction: row-reverse;
    text-align: right;
}
