/**
 * Book Details Table - Clean & Professional Style
 * جدول تفاصيل الكتب - تصميم نظيف واحترافي
 * Version: 2.5.0
 */

/* ═══════════════════════════════════════════════════════════════
   الحاوية الرئيسية
   ═══════════════════════════════════════════════════════════════ */
.book-details-wrapper {
    direction: rtl;
    margin: 5px 0 5px !important;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════
   رأس الجدول (اختياري - يمكن إزالته من PHP)
   ═══════════════════════════════════════════════════════════════ */
.book-details-header {
    background: #bc8456;
    padding: 12px 20px;
    border-radius: 4px 4px 0 0;
    border-bottom: 2px solid #a67347;
}

.book-details-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-align: center;
    line-height: 1.4 !important;
}

/* تنسيق الإيموجي في العنوان */
.book-details-title .title-icon {
    font-size: 20px;
    display: inline-block;
    margin-left: 5px;
    filter: brightness(1.2) contrast(1.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   الجدول
   ═══════════════════════════════════════════════════════════════ */
.book-details-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
    font-family: inherit;
}

.book-details-table .label-col {
    width: 35%;
}

.book-details-table .value-col {
    width: 65%;
}

/* ═══════════════════════════════════════════════════════════════
   خلايا الجدول
   ═══════════════════════════════════════════════════════════════ */
.book-details-table td {
    border: 1px solid #ddd;
    padding: 11px 14px;
    vertical-align: middle;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   العمود الأيمن (التسميات)
   ═══════════════════════════════════════════════════════════════ */
.book-details-table .label-cell {
    font-weight: 600;
    color: #111;
    background-color: #f9f9f9;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   العمود الأيسر (القيم)
   ═══════════════════════════════════════════════════════════════ */
.book-details-table .value-cell {
    font-weight: normal;
    color: #222;
    text-align: right;
    background-color: #fff;
}

.book-details-table .value-cell strong {
    color: #bc8456;
    font-weight: 700;
}

.book-details-table .value-cell .unit {
    color: #666;
    font-weight: normal;
}

/* ═══════════════════════════════════════════════════════════════
   الروابط
   ═══════════════════════════════════════════════════════════════ */
.book-details-table .term-link {
    color: #bc8456;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline;
    word-break: break-word;
    word-wrap: break-word;
}

/* أيقونة الرابط 🔗 - ظاهرة دائماً بلون أسود */
.book-details-table .term-link::after {
    content: "🔗";
    font-size: 9px;
    margin-right: 3px;
    margin-left: 1px;
    opacity: 1;
    filter: grayscale(100%);
    transition: all 0.2s ease;
    display: inline;
    vertical-align: middle;
}

.book-details-table .term-link:hover {
    color: #a67347;
}

.book-details-table .term-link:hover::after {
    transform: scale(1.15);
    filter: grayscale(0%);
}

.book-details-table .separator {
    color: #999;
    margin: 0 5px;
    font-weight: normal;
}

/* ═══════════════════════════════════════════════════════════════
   تأثير Hover خفيف على الصفوف (اختياري)
   ═══════════════════════════════════════════════════════════════ */
.book-details-table tr:hover td {
    background-color: #fafafa;
}

.book-details-table tr:hover .label-cell {
    background-color: #f5f5f5;
}

/* ═══════════════════════════════════════════════════════════════
   التصميم المتجاوب - Tablet
   ═══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
    .book-details-wrapper {
        margin: 5px 0 5px !important;
    }

    .book-details-header {
        padding: 10px 16px;
    }

    .book-details-title {
        font-size: 16px !important;
    }
    
    .book-details-title .title-icon {
        font-size: 18px;
    }

    .book-details-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .book-details-table .label-col {
        width: 43%;
    }

    .book-details-table .value-col {
        width: 57%;
    }
    
    /* تصغير أيقونة الرابط في التابلت */
    .book-details-table .term-link::after {
        font-size: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   التصميم المتجاوب - Mobile
   ═══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 480px) {
    .book-details-header {
        padding: 9px 14px;
    }

    .book-details-title {
        font-size: 15px !important;
    }
    
    .book-details-title .title-icon {
        font-size: 17px;
    }

    .book-details-table td {
        padding: 9px 10px;
        font-size: 13px;
        line-height: 1.6;
    }

    /* ✅ حل مشكلة النصوص الطويلة في الموبايل */
    .book-details-table .label-cell {
        font-size: 12px;
        white-space: normal;
        line-height: 1.4;
    }

    .book-details-table .value-cell {
        font-size: 13px;
    }

    .book-details-table .value-cell strong {
        font-size: 14px;
    }

    .book-details-table .separator {
        margin: 0 3px;
    }

    .book-details-table .label-col {
        width: 48%;
    }

    .book-details-table .value-col {
        width: 52%;
    }
    
    /* تصغير أيقونة الرابط في الموبايل */
    .book-details-table .term-link::after {
        font-size: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   شاشات صغيرة جداً
   ═══════════════════════════════════════════════════════════════ */
@media screen and (max-width: 360px) {
    .book-details-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .book-details-table .label-cell {
        font-size: 11px;
    }

    .book-details-table .value-cell {
        font-size: 12px;
    }

    .book-details-title {
        font-size: 14px !important;
    }
    
    .book-details-title .title-icon {
        font-size: 16px;
    }
    
    /* أيقونة الرابط أصغر في الشاشات الصغيرة جداً */
    .book-details-table .term-link::after {
        font-size: 7px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   تحسينات الأداء
   ═══════════════════════════════════════════════════════════════ */
.book-details-wrapper,
.book-details-table td,
.book-details-table .term-link {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}