/* ==================== خط كوفي ==================== */
@font-face {
    font-family: 'Droid Arabic Kufi';
    font-style: normal;
    font-weight: normal;
    src: url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Regular.eot);
    src: url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Regular.eot?#iefix) format('embedded-opentype'),
         url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Regular.woff2) format('woff2'),
         url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Regular.woff) format('woff'),
         url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Regular.ttf) format('truetype');
}

@font-face {
    font-family: 'Droid Arabic Kufi';
    font-style: normal;
    font-weight: bold;
    src: url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Bold.eot);
    src: url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Bold.eot?#iefix) format('embedded-opentype'),
         url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Bold.woff2) format('woff2'),
         url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Bold.woff) format('woff'),
         url(//themes.googleusercontent.com/static/fonts/earlyaccess/droidarabickufi/v3/DroidKufi-Bold.ttf) format('truetype');
}

/* ==================== الإعدادات العامة ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Droid Arabic Kufi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* ==================== الحاوية الرئيسية ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== الهيدر ==================== */
.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #667eea;
    font-size: 28px;
    font-weight: bold;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ==================== الأزرار ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-family: 'Droid Arabic Kufi', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #e0e7ff;
    color: #667eea;
}

.btn-secondary:hover {
    background: #c7d2fe;
    transform: translateY(-2px);
}

.btn-danger {
    background: #fee;
    color: #e11d48;
}

.btn-danger:hover {
    background: #fecaca;
    transform: translateY(-2px);
}

.btn-like {
    background: #fff1f2;
    color: #e11d48;
    border: 2px solid #fecaca;
}

.btn-like:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

.btn-like.liked {
    background: #e11d48;
    color: white;
    border-color: #e11d48;
}

.btn-like.liked:hover {
    background: #be123c;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* ==================== الكروت ==================== */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

/* ==================== المواضيع ==================== */
.topic-title {
    color: #9f0000; /*#1e293b; */
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.topic-meta {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 15px;
}

.topic-content {
    color: #334155;
    line-height: 1.8;
    margin-bottom: 15px;
}

.topic-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.topic-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.topic-images img:hover {
    transform: scale(1.05);
}

.topic-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================== النماذج ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select,
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: 'Droid Arabic Kufi', sans-serif;
		    background:#f4f4f4;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ==================== رفع الملفات ==================== */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background: #f1f5f9;
    padding: 12px 24px;
    border-radius: 10px;
    border: 2px dashed #cbd5e1;
    transition: all 0.3s;
    font-family: 'Droid Arabic Kufi', sans-serif;
}

.file-input-wrapper:hover {
    border-color: #667eea;
    background: #e0e7ff;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* ==================== الردود ==================== */
.reply-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.reply-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-right: 4px solid #667eea;
    position: relative;
}

[dir="ltr"] .reply-item {
    border-right: none;
    border-left: 4px solid #667eea;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.reply-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 18px;
    padding: 8px 15px;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* ==================== الرسائل ==================== */
.message {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ==================== الأقسام ==================== */
.section-title {
    color: #1e293b;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 0 5px;
}

.categories-grid {
    margin-bottom: 30px;
}

.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-name {
    color: #1e293b;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.category-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.category-stats {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
}

.categories-filter {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 5px 10px;
    border-radius: 25px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.topic-with-category {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
    width: fit-content;
}

.topic-pin-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.topic-featured-badge {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    color: #7c3aed;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.moderator-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 5px;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.moderator-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid #fbbf24;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

@media (max-width: 768px) {
    .categories-container {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
    
    .categories-filter {
        padding: 12px 15px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* ==================== الإعجابات ==================== */
.topics-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

thead th {
    padding: 20px;
    text-align: right;
    font-weight: 600;
    font-size: 16px;
}

[dir="ltr"] thead th {
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.3s;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 20px;
    text-align: right;
}

[dir="ltr"] tbody td {
    text-align: left;
}

table .topic-title {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    text-decoration: none;
    transition: color 0.3s;
}

table .topic-title:hover {
    color: #667eea;
}

.topic-author {
    color: #64748b;
    font-size: 14px;
}

.replies-count {
    background: #e0e7ff;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.views-count {
    background: #fef3c7;
    color: #d97706;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.last-activity {
    color: #64748b;
    font-size: 14px;
}

.no-topics {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-topics p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* ==================== شريط الإحصائيات ==================== */
.stats-bar {
    background: white;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
}

/* ==================== Modal للصور ==================== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #667eea;
}

/* ==================== تصميم متجاوب ==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 22px;
        width: 100%;
    }
    
    .header-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .header-actions .btn {
        flex: 1;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .topic-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .topic-images img {
        height: 100px;
    }
    
    .topics-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    thead th,
    tbody td {
        padding: 15px 10px;
        font-size: 14px;
    }
    
    table .topic-title {
        font-size: 16px;
    }
    
    .stats-bar {
        justify-content: center;
    }
    
    .card {
        padding: 15px;
    }
    
    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .reply-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .reply-number {
        align-self: flex-start;
    }
    
    .topic-actions {
        flex-direction: column;
    }
    
    .topic-actions .btn {
        width: 100%;
        text-align: center;
    }
}