/* ============== أنماط عامة ============== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 1100;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.notification.show {
    opacity: 1;
    transform: translateY(0);
}
.notification.success {
    background-color: #28a745;
}
.notification.error {
    background-color: #dc3545;
}
.notification.warning {
    background-color: #ffc107;
    color: #333;
}
.notification.info {
    background-color: #17a2b8;
}

/* ============== عناصر الصفحة ============== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}
.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
}
.add-button {
    margin-bottom: 20px;
}
.add-button .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}
.version-badge {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    color: #495057;
}
.program-name {
    font-weight: 500;
    color: #0056b3;
}
.description-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-style: dotted;
}
.description-cell:hover {
    white-space: normal;
    overflow: visible;
    color: var(--primary-dark);
}

.btn-danger {
    transition: all 0.3s ease;
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ============== زرين التحميل والرفع (موحد) ============== */
.btn-download {
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(18, 181, 176, 0.3);
    background-color: var(--primary-dark);
}
.btn-download.loading {
    pointer-events: none;
    opacity: 0.8;
}
.btn-download .loading-spinner {
    display: none;
}
.btn-download.loading .loading-spinner {
    display: inline-block;
}
.btn-download.loading .fa-download {
    display: none;
}

/* ============== نافذة التحميل المنبثقة الموحدة ============== */
.download-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}
.download-modal.show {
    display: flex;
}
.download-modal .modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}
.download-modal h3 {
    margin-bottom: 1rem;
}
.download-icon {
    font-size: 3rem;
    color: #12b5b0;
    margin-bottom: 1rem;
}
.progress-container {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
}
.progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 10px;
    transition: width 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: progressStripes 1s linear infinite;
}
@keyframes progressStripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}

/* أنماط لشارة النظام */
.system-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 8px;
}
.system-badge.program-badge {
    background-color: #e3f2fd;
    color: #0d47a1;
}
.system-badge.seraj {
    background-color: #f8d7da;
    color: #721c24;
}
.system-badge.crystal {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* أنماط مخصصة للتاريخ */
.date-cell {
    white-space: nowrap;
    color: #6c757d;
    font-size: 0.9em;
}

/* أنماط للبطاقة الرئيسية */
.updates-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}
.updates-card:hover {
    box-shadow: 0 0 25px rgba(0,0,0,0.1);
}
.updates-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* تحسينات للجدول */
.table {
    margin-bottom: 0;
}
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}
.table td {
    vertical-align: middle;
}
.update-item {
    transition: all 0.2s ease;
}
.update-item:hover {
    background-color: rgba(18, 181, 176, 0.05);
}

/* أنماط لقسم العنوان والوصف */
.updates-header {
    margin-bottom: 2rem;
}
.updates-header h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}
.updates-header h1:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}
.updates-header p {
    color: #6c757d;
    max-width: 800px;
}

/* أنماط قسم المعلومات */
.info-section .card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
}
.info-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.info-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.info-section .card-header h5 {
    color: var(--primary-color);
}
.info-section .card-body {
    padding: 1.5rem;
}
.info-section ul {
    padding-right: 1.2rem;
}
.info-section li {
    margin-bottom: 0.5rem;
}

/* نافذة الوصف المنبثقة */
.description-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.description-modal.show {
    display: flex;
}
.description-modal .modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    display: flex;
    flex-direction: column;
}
.description-modal h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    padding-right: 20px;
}
.description-content {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background-color: #f8f9fa;
}
.description-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.description-modal .close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    z-index: 1;
}
.description-modal .close-btn:hover {
    color: var(--primary-color);
}

/* تحسينات التوافق مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .description-modal .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: 1.5rem;
    }
    
    .description-content {
        max-height: 45vh;
        padding: 0.75rem;
    }
}
