/* ===== إعدادات عامة ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 20px 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-btn i {
    margin-left: 8px;
    font-size: 1.2em;
}

/* ===== Tab Content ===== */
.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Card ===== */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
}

.card h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.card h2 i {
    margin-left: 10px;
    color: #667eea;
}

.description {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 1.05em;
}

/* ===== Upload Area ===== */
.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 50px 30px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 25px;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.drag-over {
    border-color: #667eea;
    background: #e6edff;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
}

.upload-area p {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1em;
    margin-top: 20px;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Form Controls ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.9em;
}

/* ===== Files List ===== */
.files-list {
    margin: 20px 0;
}

.file-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateX(-5px);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.file-item-icon {
    font-size: 2em;
    color: #667eea;
}

.file-item-details h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1em;
}

.file-item-details p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.file-item-actions {
    display: flex;
    gap: 10px;
}

.file-item-actions button {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* ===== File Info ===== */
.file-info {
    background: #f0f4ff;
    border: 1px solid #667eea;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.file-info p {
    margin: 5px 0;
    color: #333;
}

.file-info strong {
    color: #667eea;
}

/* ===== Messages ===== */
#messages {
    padding: 0 30px;
    margin-top: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ===== Results ===== */
.results {
    padding: 30px;
}

.result-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.result-item h3 {
    color: #333;
    margin-bottom: 15px;
}

.download-btn {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    font-size: 1.2em;
    margin-top: 20px;
}

/* ===== Footer ===== */
.footer {
    background: #f8f9fa;
    padding: 30px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.footer p {
    margin: 5px 0;
    color: #6c757d;
}

.footer .small {
    font-size: 0.9em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        min-width: 100%;
    }

    .tab-content {
        padding: 20px;
    }

    .card {
        padding: 20px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-item-actions {
        width: 100%;
        margin-top: 10px;
    }

    .file-item-actions button {
        flex: 1;
    }
}

