/* Custom Pages Styling - RTL */

.custom-page-container {
    padding: 60px 0;
    min-height: 60vh;
}

.custom-page-content {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.8;
    color: #333;
    direction: rtl;
    text-align: right;
}

.custom-page-content h1,
.custom-page-content h2,
.custom-page-content h3,
.custom-page-content h4,
.custom-page-content h5,
.custom-page-content h6 {
    color: #2c3e50;
    margin-bottom: 20px;
    margin-top: 30px;
    font-weight: 600;
    text-align: right;
}

.custom-page-content h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid #e39823;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.custom-page-content h2 {
    font-size: 2rem;
    color: #4b1e1e;
}

.custom-page-content h3 {
    font-size: 1.5rem;
    color: #666;
}

.custom-page-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.custom-page-content ul,
.custom-page-content ol {
    margin: 20px 0;
    padding-right: 30px;
    padding-left: 0;
}

.custom-page-content li {
    margin-bottom: 8px;
    text-align: right;
}

.custom-page-content blockquote {
    background: #f8f9fa;
    border-right: 4px solid #e39823;
    border-left: none;
    margin: 30px 0;
    padding: 20px 30px;
    font-style: italic;
    border-radius: 8px 0 0 8px;
}

.custom-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.custom-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.custom-page-content table th,
.custom-page-content table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.custom-page-content table th {
    background: #4b1e1e;
    color: white;
    font-weight: 600;
}

.custom-page-content table tr:hover {
    background: #f8f9fa;
}

.custom-page-content a {
    color: #e39823;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-page-content a:hover {
    color: #4b1e1e;
    text-decoration: underline;
}

.custom-page-content .btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4b1e1e 0%, #e39823 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

.custom-page-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 30, 30, 0.3);
    color: white;
    text-decoration: none;
}

.custom-page-content .alert {
    padding: 15px 20px;
    margin: 20px 0;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: right;
}

.custom-page-content .alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.custom-page-content .alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.custom-page-content .alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.custom-page-content .alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.custom-page-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
    font-size: 0.9em;
    direction: ltr;
    display: inline-block;
}

.custom-page-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    direction: ltr;
    text-align: left;
}

.custom-page-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* RTL specific adjustments */
html[dir="rtl"] .custom-page-content ul {
    list-style-position: inside;
}

html[dir="rtl"] .custom-page-content ol {
    list-style-position: inside;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-page-container {
        padding: 40px 0;
    }
    
    .custom-page-content h1 {
        font-size: 2rem;
    }
    
    .custom-page-content h2 {
        font-size: 1.5rem;
    }
    
    .custom-page-content ul,
    .custom-page-content ol {
        padding-right: 20px;
        padding-left: 0;
    }
    
    .custom-page-content table {
        font-size: 0.9rem;
    }
    
    .custom-page-content table th,
    .custom-page-content table td {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    .custom-page-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .custom-page-content h1 {
        page-break-before: always;
    }
    
    .custom-page-content h1,
    .custom-page-content h2,
    .custom-page-content h3 {
        page-break-after: avoid;
    }
    
    .custom-page-content img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}