﻿/* =====================================
   GENERAL PAGE LAYOUT
===================================== */

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    direction: rtl;
}


.title-frame {
    background-color: #059661;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
}

.page-frame {
    background-color: #10b981;
    padding: 15px;
}

.page-card {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 10px;
}

/* =====================================
   SEARCH BAR
===================================== */

.search-wrapper {
    margin-top: 5px;
}

/*.search-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);  👈 عدد العناصر 
    gap: 10px;
}
*/
.search-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    width: 100%;
}


.pair {
    display: flex;
    flex-direction: column;
}

    .pair label {
        font-size: 14px;
        margin-bottom: 4px;
    }

.search-bar input,
.search-bar select {
    padding: 7px;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 100%;
}

/* زر البحث */
/*.search-btn-wrapper {
    width: 100%;
}
*/
.search-btn-wrapper {
    display: flex;
    flex-direction: column;
}

    .search-btn-wrapper .fake-label {
        height: 18px; /* نفس ارتفاع label الحقيقي */
        margin-bottom: 4px;
    }

.search-btn {
    width: 100%;
    height: 42px;
    background-color: #166534;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

    .search-btn:hover {
        background-color: #1e40af;
    }

/* موبايل */
@media (max-width: 600px) {
    .search-btn-wrapper .fake-label {
        display: none;
    }
    .search-bar {
        grid-template-columns: repeat(2, 1fr);
        /*grid-template-columns: 1fr 1fr;*/
    }

    /* من - إلى */
    .pair:nth-child(1),
    .pair:nth-child(2) {
        grid-column: span 1;
    }

    /* المحافظة + المنطقة */
    .pair:nth-child(3),
    .pair:nth-child(4) {
        grid-column: span 1;
    }

    /* زر البحث */
    .search-btn-wrapper {
        grid-column: span 2;
    }
}

/* =====================================
   TABLE HEADER BAR
===================================== */

.table-count-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background-color: #166534;
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    direction: ltr; /* يمنع الانعكاس */
    flex-wrap: nowrap; /* سطر واحد */
}

/* عدد المعاينات — يمين */
.count-text {
    white-space: nowrap;
    font-weight: bold;
    margin-left: auto; /* يزقه لليمين */
    direction: rtl; /* عربي طبيعي */
}

/* الأزرار — شمال */
.export-box {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    direction: ltr;
}

/* الأزرار */
.export-btn,
.filter-toggle-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
}

    .export-btn.excel {
        background-color: #10b981;
    }

    .export-btn.pdf {
        background-color: #d97706;
    }

.filter-toggle-btn {
    background-color: #dc3545;
}

/* =====================================
   TABLE
===================================== */

.table-frame {
    background: white;
    padding: 5px;
    border-radius: 8px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.inspect-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

    .inspect-table th {
        background-color: #3e6b5a;
        color: white;
        padding: 8px;
        position: sticky;
        top: 0;
    }

    .inspect-table td {
        padding: 8px;
        border-bottom: 1px solid #eee;
        text-align: center;
        white-space: nowrap;
    }

    .inspect-table tr:nth-child(even) {
        background-color: #f5f8ff;
    }

    .inspect-table tr:hover {
        background-color: #eef2ff;
    }

/* زر عرض */

.view-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
}

    .view-btn:hover {
        background-color: #8b0000;
    }

/* =====================================
   FILTER ROW
===================================== */

.filter-row input {
    width: 100%;
    padding: 4px;
    font-size: 12px;
}

/* =====================================
   PAGINATION
===================================== */

.pagination-frame {
    background-color: #60947c;
    padding: 7px;
    border-radius: 7px;
    margin-top: 10px;
}

.pagination-inner {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

    .pagination-inner button {
        background: white;
        border: none;
        padding: 5px 10px;
        border-radius: 5px;
        cursor: pointer;
        font-weight: bold;
    }

        .pagination-inner button.active {
            background-color: #83b9a6;
        }

        .pagination-inner button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
/* يمنع أي عنصر يكبر خارج الشاشة */
* {
    box-sizing: border-box;
}

/* يمنع overflow أفقي */
body {
    overflow-x: hidden;
}

.search-bar {
    max-width: 100%;
}

.pair {
    min-width: 0;
}


@media (max-width: 768px) {

    .export-box {
        gap: 4px;
        max-width: 70%;
    }

    .export-btn,
    .filter-toggle-btn {
        padding: 5px 7px;
        font-size: 12px;
    }

    .count-text {
        font-size: 13px;
    }
}
