






/* =========================================
   1. الإعدادات العامة والمتغيرات
   ========================================= */

:root {
    --primary-green: #064d20;
    --accent-green: #08b22d;
    --dark-green: #0d944a;
    --gradient-header: linear-gradient(135deg, #43ee4c 0%, #1ea30c 100%);
    --gradient-body: linear-gradient(135deg, #1e1e2f, #2b2b40);
    --hover-cyan: rgba(0, 255, 255, 0.15);
    --text-white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.08);
}

body {
    margin: 0;
    font-family: "Tahoma";
    background: var(--gradient-body);
    width: 100%;
}

#popup-data, #popup-content {
    background: var(--gradient-body);
}

#page-content {
    display: block;
}

/* =========================================
   2. رأس الصفحة
   ========================================= */

header {
    min-width: 100%;
    background: var(--primary-green);
    color: var(--text-white);
    padding: 20px;
    text-align: center;
    font-size: 35px;
    font-weight: bold;
}

/* =========================================
   3. الحاوية الرئيسية
   ========================================= */

.container {
    padding: 20px;
}

/* =========================================
   4. أدوات التحكم (Tools)
   ========================================= */

.tools input, .tools select {
    padding: 10px;
    font-size: 18px;
    margin: 5px;
}

.tools button {
    padding: 10px 20px;
    background: var(--primary-green);
    color: var(--text-white);
    border: none;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
}

/* =========================================
   5. الجدول الرئيسي
   ========================================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #333;
    padding: 8px;
    color:#ffffffce;
    text-align: center;
    
}

th {
    padding: 1.3rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.85rem;
    
}

thead {
    background: var(--gradient-header);
    color: var(--text-white);
    position: sticky;
    top: 0;
    z-index: 2;
}

tbody tr {
    background: var(--glass-bg);
    /* transition: 0.3s; */
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.08);
}

#booksTable tbody tr:hover {
    background: var(--hover-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

#booksTable tbody tr:hover td {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* =========================================
   6. تقييد الارتفاع للفقرات داخل الخلايا
   ========================================= */

td p {
    max-height: 140px;
    max-width: 140px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    line-clamp: 5;
}

/* =========================================
   7. ترقيم الصفحات (Pagination)
   ========================================= */

#pagination {
    text-align: center;
    margin-top: 20px;
}

#pagination button {
    padding: 10px 15px;
    border: none;
    background: var(--primary-green);
    color: var(--text-white);
    margin: 3px;
    cursor: pointer;
}

/* =========================================
   8. النافذة المنبثقة #popup
   ========================================= */

#popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

#popup-content {
    width: 60%;
    margin: 100px auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    gap: 15px;
}

#close-popup {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 22px;
    color: red;
}

/* =========================================
   9. النافذة المنبثقة .modal-overlay (النسخة الأولى)
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-overlay .table-container {
    background: white;
    border-radius: 20px;
    width: 60%;
    max-width: 1200px;
    max-height: 100vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 15px 50px rgba(214, 0, 0, 0.4);
}

.modal-overlay .table-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-overlay .close-btn {
    font-size: 30px;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
    transition: transform 0.2s ease;
}

.modal-overlay .close-btn:hover {
    transform: rotate(90deg);
}

.modal-overlay .table-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

/* =========================================
   10. النافذة المنبثقة .modal-overlay (النسخة الثانية)
   ========================================= */

.modal-overlay.active .table-container {
    background: linear-gradient(135deg, #2e2e2e 0%, #707070 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    transform: scale(1);
}

.modal-overlay.active .table-header {
    background: linear-gradient(135deg, #0d944a 0%, #08b22d 100%);
    color: rgb(0, 0, 0);
    padding: 20px 30px;
    position: relative;
}

.table-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-overlay.active .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: rgb(241, 10, 10);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.modal-overlay.active .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-overlay.active .table-body {
    padding: 30px;
    max-height: calc(90vh - 140px);
}

/* =========================================
   11. نموذج الإضافة (Form)
   ========================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.div_add {
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s ease forwards;
}

.div_add[style*="grid-column: span"] {
    grid-column: span 2 !important;
}

.lable_add {
    font-weight: 600;
    color: #000000;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lable_add::after {
    content: "*";
    color: #e11d48;
    font-size: 1.2rem;
    display: none;
}

input[required] + .lable_add::after,
textarea[required] + .lable_add::after {
    display: inline;
}

.input_add, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #949499;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.input_add:focus, textarea:focus {
    outline: none;
    border-color: #0891b2;
    background: white;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
    transform: translateY(-2px);
}

.input_add:hover, textarea:hover {
    border-color: #2c940d;
}

.submit-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.submit-btn {
    background: linear-gradient(135deg, #2c940d 0%, #08b21f 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* =========================================
   12. Scrollbar مخصص
   ========================================= */

.table-body::-webkit-scrollbar {
    width: 8px;
}

.table-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.table-body::-webkit-scrollbar-thumb {
    background: #33940d;
    border-radius: 10px;
}

.table-body::-webkit-scrollbar-thumb:hover {
    background: #33940d;
}

/* =========================================
   13. تصميم متجاوب
   ========================================= */

@media (max-width: 768px) {
    .table-container {
        width: 95%;
        margin: 20px 10px;
    }
    
    .table-body {
        padding: 20px 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-title {
        font-size: 1.4rem;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .div_add[style*="grid-column: span"] {
        grid-column: span 1 !important;
    }
}

/* =========================================
   14. تأثيرات الدخول (Animations)
   ========================================= */

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

.div_add:nth-child(1) { animation-delay: 0.05s; }
.div_add:nth-child(2) { animation-delay: 0.1s; }
.div_add:nth-child(3) { animation-delay: 0.15s; }
.div_add:nth-child(4) { animation-delay: 0.2s; }
.div_add:nth-child(5) { animation-delay: 0.25s; }
.div_add:nth-child(6) { animation-delay: 0.3s; }
.div_add:nth-child(7) { animation-delay: 0.35s; }
.div_add:nth-child(8) { animation-delay: 0.4s; }
.div_add:nth-child(9) { animation-delay: 0.45s; }
.div_add:nth-child(10) { animation-delay: 0.5s; }
.div_add:nth-child(11) { animation-delay: 0.55s; }
.div_add:nth-child(12) { animation-delay: 0.6s; }
.div_add:nth-child(13) { animation-delay: 0.65s; }
.div_add:nth-child(14) { animation-delay: 0.7s; }








