/* =====================================================
   VTT to PDF - CSS (مستوحى من تصميم DonePDF)
   متوافق مع هيكل VTT to PDF Converter
   ===================================================== */

/* ===== Main Container ===== */
.tool-wrapper[data-tool="vtt-to-pdf-converter"] {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: #1e293b;
}

/* ===== Upload Area ===== */
.upload-area {
    background: #f8fafc;
    border: 2px dashed #d1d9e6;
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    cursor: pointer;
    margin-bottom: 1.5rem;
}
.upload-area:hover {
    border-color: #0067b8;
    background: #f1f5f9;
}
.upload-area.drag-over {
    border-color: #0067b8;
    background: #e6f0fa;
    box-shadow: 0 0 0 4px rgba(0, 103, 184, 0.15);
}
.upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.upload-icon {
    font-size: 3rem;
    color: #0067b8;
    margin-bottom: 0.25rem;
}
.upload-text {
    font-weight: 700;
    font-size: 1.2rem;
    color: #0f172a;
}
.upload-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.1rem 0 0.5rem;
}
.upload-btn {
    background: #0067b8;
    color: #fff;
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.upload-btn:hover {
    background: #005499;
    box-shadow: 0 4px 12px rgba(0, 103, 184, 0.25);
}
.upload-btn:active { transform: scale(0.97); }

/* ===== Error Message ===== */
.error-message {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    color: #991b1b;
    font-weight: 500;
    font-size: 0.9rem;
    display: none;
}
.error-message.show { display: block; }

/* ===== Editor Layout ===== */
.editor-layout {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9edf2;
    margin-top: 1.5rem;
}
.editor-layout.hidden { display: none; }

/* ===== File Box ===== */
.file-box {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e9edf2;
    margin-bottom: 1.25rem;
    display: none;
}
.file-box.show { display: flex; }
.file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    flex: 1;
}
.file-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
    word-break: break-all;
    flex: 1;
    min-width: 120px;
}
.file-size {
    color: #475569;
    font-size: 0.85rem;
    background: #eef2f6;
    padding: 0.15rem 0.8rem;
    border-radius: 1rem;
    white-space: nowrap;
}
.remove-file {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 1rem;
    transition: color 0.2s, background 0.2s;
}
.remove-file:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* ===== Content Area ===== */
.content-area {
    margin-bottom: 1.25rem;
}
.vtt-textarea {
    width: 100%;
    min-height: 350px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d9e6;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    line-height: 1.6;
}
.vtt-textarea:focus {
    border-color: #0067b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 103, 184, 0.12);
}
.vtt-textarea::placeholder {
    color: #94a3b8;
}

/* ===== Tool Settings (PDF Options) ===== */
.tool-settings {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e9edf2;
    margin-bottom: 1.25rem;
}
.tool-settings h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.tool-settings h3 i { color: #0067b8; }

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}
.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.option-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
}
.option-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d9e6;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364758b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}
.option-select:focus {
    border-color: #0067b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 103, 184, 0.12);
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1rem 0 0.5rem 0;
}
.btn {
    padding: 0.6rem 1.8rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn-primary {
    background: #0067b8;
    color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
    background: #005499;
    box-shadow: 0 4px 12px rgba(0, 103, 184, 0.25);
}
.btn-secondary {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #d1d9e6;
}
.btn-secondary:hover { background: #e2e8f0; }
.btn-success {
    background: #0b7e3d;
    color: #ffffff;
}
.btn-success:hover:not(:disabled) {
    background: #096633;
    box-shadow: 0 4px 12px rgba(11, 126, 61, 0.25);
}

/* ===== Progress Bar ===== */
.progress-container {
    background: #e9edf2;
    border-radius: 2rem;
    height: 24px;
    margin: 1rem 0 0.5rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0067b8, #3b8fd9);
    border-radius: 2rem;
    transition: width 0.4s ease;
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.3px;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

/* ===== Success Message ===== */
.success-message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #065f46;
    font-weight: 500;
    font-size: 0.9rem;
}
.success-message i {
    color: #0b7e3d;
    font-size: 1.25rem;
}

/* ===== Preview Section ===== */
.preview-section {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e9edf2;
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.preview-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}
.preview-content iframe {
    width: 100%;
    height: 500px;
    border: 1px solid #e9edf2;
    border-radius: 0.5rem;
    background: #fff;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .tool-wrapper[data-tool="vtt-to-pdf-converter"] {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    .editor-layout {
        padding: 1rem;
    }
    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .action-buttons .btn {
        justify-content: center;
        width: 100%;
    }
    .vtt-textarea {
        min-height: 200px;
        font-size: 0.85rem;
    }
    .preview-content iframe {
        height: 350px;
    }
}
@media (max-width: 480px) {
    .upload-area {
        padding: 1.5rem 1rem;
    }
    .upload-text {
        font-size: 1rem;
    }
    .upload-hint {
        font-size: 0.8rem;
    }
    .upload-btn {
        font-size: 0.85rem;
        padding: 0.4rem 1.2rem;
    }
    .file-name {
        font-size: 0.8rem;
        width: 100%;
    }
    .preview-content iframe {
        height: 250px;
    }
    .vtt-textarea {
        min-height: 150px;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
}

/* ===== RTL Support ===== */
html[dir="rtl"] .btn i,
html[dir="rtl"] .upload-btn i,
html[dir="rtl"] .tool-settings h3 i,
html[dir="rtl"] .success-message i {
    margin-left: 0.4rem;
    margin-right: 0;
}
html[dir="rtl"] .option-select {
    background-position: left 12px center;
    padding-right: 0.75rem;
    padding-left: 32px;
}
html[dir="rtl"] .remove-file i {
    margin: 0;
}
html[dir="rtl"] .vtt-textarea {
    direction: rtl;
    text-align: right;
}
html[dir="rtl"] .progress-text {
    left: auto;
    right: 0;
}