﻿.table th {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: #fff;
    text-align: center;
    padding: 12px 8px;
    font-weight: 600;
    border: none;
    vertical-align: middle;
    font-size: 14px;
}

.table td {
    text-align: center;
    vertical-align: middle;
    padding: 10px 8px;
    border-color: #dee2e6;
    font-size: 14px;
}

.result-info {
    background: #e3f2fd;
    border-left: 4px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.table {
    margin-top: 20px;
    margin-bottom: 40px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    width: 100%; /* تغيير من auto إلى 100% */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(52, 152, 219, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* تضييق عرض الأعمدة */
.table th:nth-child(1),
.table td:nth-child(1) { 
    width: 80px; 
}

.table th:nth-child(2),
.table td:nth-child(2) { 
    width: 120px; 
}

.table th:last-child,
.table td:last-child { 
    width: 100px; 
}

@media print {
    .action-buttons, .whatsapp-btn {
        display: none !important;
    }
    
    body { 
        background: white;
    }
    
    .card { 
        box-shadow: none; 
    }
}

/* ✅ تحسينات أساسية للجوال */
@media (max-width: 768px) {
    .table {
        font-size: 12px;
        width: 100%;
        margin-top: 10px;
        margin-bottom: 20px;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* إزالة التحديد الثابت للعرض في الجوال */
    .table th:nth-child(1),
    .table td:nth-child(1),
    .table th:nth-child(2),
    .table td:nth-child(2),
    .table th:last-child,
    .table td:last-child {
        width: auto;
        min-width: 60px;
    }
}

/* ✅ تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .table {
        font-size: 11px;
        border-radius: 8px;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .table th {
        padding: 10px 4px;
        font-size: 10px;
    }
}

.reports-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 0;
    margin: -20px -15px 0 -15px;
}

.reports-container {
    padding: 20px 0;
}

.report-btn {
    display: block;
    padding: 25px 20px;
    margin-bottom: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.report-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.report-btn:hover::before {
    left: 100%;
}

.report-btn:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    text-decoration: none;
    color: white;
}

.report-btn.primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.report-btn.success:hover {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    border-color: #56ab2f;
}

.report-btn.info:hover {
    background: linear-gradient(135deg, #3498db 0%, #85d8ce 100%);
    border-color: #3498db;
}

.report-btn.warning:hover {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    border-color: #f39c12;
}

.report-btn.danger:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #fd79a8 100%);
    border-color: #e74c3c;
}

.report-btn.purple:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #d63384 100%);
    border-color: #8e44ad;
}

.report-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.report-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.report-desc {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0;
}
.report-container {
    margin-top: 0;
    padding-top: 20px;
}

/* ✅ تحسينات الجدول للجوال - الحل الأمثل */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 15px 0;
}

.table-responsive table {
    width: 100%;
    min-width: 600px; /* عرض مناسب للجوال */
    border-collapse: collapse;
}

/* ✅ تحسين شريط التمرير في الجوال */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #34495e, #2c3e50);
}

/* ✅ تحسينات إضافية للجوال */
@media (max-width: 768px) {
    .report-btn {
        padding: 20px 15px;
    }
    
    .report-icon {
        font-size: 2rem;
    }
    
    .report-title {
        font-size: 1.1rem;
    }
    
    .report-desc {
        font-size: 0.9rem;
    }
    
    /* تحسين عرض الجدول في الجوال */
    .table-responsive {
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .table-responsive table {
        min-width: 500px; /* تقليل العرض للجوال */
    }
    
    .table th,
    .table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .report-btn {
        padding: 15px 10px;
    }
    
    .table-responsive table {
        min-width: 400px; /* عرض أقل للشاشات الصغيرة */
    }
    
    .table th,
    .table td {
        max-width: 120px;
        font-size: 10px;
    }
    
    .table th {
        font-size: 9px;
        padding: 8px 3px;
    }
}

/* ✅ تحسينات للخلايا الطويلة */
.table td {
    position: relative;
}

/* ✅ تأثير عند التمرير على الجوال */
@media (max-width: 768px) {
    .table-responsive {
        position: relative;
    }
    
    .table-responsive::after {
        content: "← اسحب لرؤية المزيد →";
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
        background: rgba(52, 152, 219, 0.9);
        color: white;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 10px;
        animation: bounceHint 2s infinite;
        pointer-events: none;
    }
}

@keyframes bounceHint {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    40% {
        transform: translateY(-50%) translateX(-5px);
    }
    60% {
        transform: translateY(-50%) translateX(-3px);
    }
}

/* ✅ إخفاء التلميح بعد أول تمرير */
.table-responsive.scrolled::after {
    display: none;
}