/* الحاوية العامة */
.tt-wrapper {
    margin: 30px auto;
    border: 1px solid #ccc;
    padding: 20px;
    max-width: 100%;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    background-color: #fefefe;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* الفلاتر */
.tt-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.tt-filters input,
.tt-filters select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 140px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s ease;
}

.tt-filters input:focus,
.tt-filters select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

/* Loading indicator */
.tt-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.tt-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table container */
.tt-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* الجدول */
.tt-tenders-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    background-color: white;
}

/* تصميم رأس الجدول (Excel style) */
.tt-tenders-table thead {
    background: linear-gradient(to bottom, #7fbf4d 0%, #69a63f 100%);
    color: white;
}

.tt-tenders-table thead th {
    padding: 12px 10px;
    border: 1px solid #ddd;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* محتوى الجدول */
.tt-tenders-table td {
    padding: 12px 10px;
    border: 1px solid #ddd;
    vertical-align: top;
    max-width: 200px;
    word-wrap: break-word;
}

/* Zebra striping */
.tt-tenders-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.tt-tenders-table tbody tr:hover {
    background-color: #f0f8ff;
}

/* الروابط */
.tt-view-details {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.tt-view-details:hover {
    color: #005177;
    background-color: rgba(0,115,170,0.1);
    text-decoration: underline;
}

/* الترقيم */
.tt-pagination {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
}

.tt-pagination button {
    padding: 8px 12px;
    margin: 2px;
    border: 1px solid #aaa;
    background: #eee;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tt-pagination button:hover {
    background: #ddd;
    transform: translateY(-1px);
}

.tt-pagination button.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* المودال */
#tt-modal-background {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

#tt-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#tt-modal h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

#tt-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

#tt-modal-close:hover {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tt-wrapper {
        padding: 15px;
        margin: 15px auto;
    }
    
    .tt-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .tt-filters input,
    .tt-filters select {
        width: 100%;
        min-width: auto;
    }
    
    .tt-tenders-table {
        font-size: 12px;
    }
    
    .tt-tenders-table th,
    .tt-tenders-table td {
        padding: 8px 6px;
    }
    
    #tt-modal {
        width: 95%;
        padding: 20px;
    }
}

/* Print styles */
@media print {
    .tt-filters,
    .tt-pagination,
    .tt-view-details {
        display: none !important;
    }
    
    .tt-wrapper {
        border: none;
        box-shadow: none;
    }
    
    .tt-tenders-table {
        font-size: 10px;
    }
}