/* Properties Table Styles - Modern & Responsive */

.properties-table-section {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header h2 {
    color: #f8fafc;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.table-search {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 450px;
}

.table-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.table-search input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    direction: rtl;
}

.table-search input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

.table-search input::placeholder {
    color: #94a3b8;
}

.table-info {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) rgba(15, 23, 42, 0.3);
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

.properties-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    direction: rtl;
    table-layout: fixed;
}

.properties-table thead {
    background: rgba(59, 130, 246, 0.15);
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.properties-table th {
    padding: 1rem 0.75rem;
    font-weight: 600;
    color: #bfdbfe;
    white-space: nowrap;
    font-size: 0.9rem;
    text-align: right;
    vertical-align: middle;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.properties-table th.col-number,
.properties-table th.col-type,
.properties-table th.col-area,
.properties-table th.col-beds,
.properties-table th.col-baths,
.properties-table th.col-actions {
    text-align: center;
}

.properties-table td {
    padding: 0.875rem 0.75rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 0.875rem;
    vertical-align: middle;
    text-align: right;
    background: rgba(15, 23, 42, 0.6);
}

.properties-table td.col-number {
    text-align: center;
    font-weight: 700;
    color: #94a3b8;
    width: 60px;
}

.properties-table td.col-title {
    text-align: right;
    font-weight: 600;
    color: #f1f5f9;
    width: 220px;
}

.properties-table td.col-location {
    text-align: right;
    color: #cbd5e1;
    width: 180px;
}

.properties-table td.col-type {
    text-align: center;
    width: 120px;
}

.properties-table td.col-price {
    text-align: right;
    font-weight: 700;
    color: #60a5fa;
    direction: rtl;
    width: 160px;
}

.properties-table td.col-area {
    text-align: center;
    color: #e2e8f0;
    width: 100px;
}

.properties-table td.col-beds,
.properties-table td.col-baths {
    text-align: center;
    font-weight: 600;
    color: #cbd5e1;
    width: 80px;
}

.properties-table td.col-actions {
    text-align: center;
    width: 130px;
}

.properties-table tbody tr {
    transition: all 0.2s ease;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
}

.properties-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.15);
}

.properties-table tbody tr:hover td {
    background: transparent;
}

.properties-table tbody tr:last-child td {
    border-bottom: none;
}

.property-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    min-width: 85px;
}

.type-residential {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.type-commercial {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.type-industrial {
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.type-land {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.action-btn {
    padding: 0.5rem 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    min-width: 80px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

.action-btn i {
    font-size: 0.75rem;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    flex-wrap: wrap;
    direction: rtl;
}

.pagination-btn {
    padding: 0.65rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.4);
}

.pagination-btn i {
    font-size: 0.85rem;
}

.pagination-pages {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    direction: ltr;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.page-number:hover:not(.active) {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.page-number.active {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border-color: rgba(37, 99, 235, 0.8);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    cursor: default;
}

.page-ellipsis {
    padding: 0 0.5rem;
    color: #94a3b8;
    font-weight: 600;
    user-select: none;
}

.no-properties {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
}

.no-properties i {
    font-size: 3rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.no-properties h3 {
    color: #cbd5e1;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.no-properties p {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .properties-table td.col-title {
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .properties-table-section {
        padding: 1rem;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        max-width: 100%;
    }

    .table-info {
        text-align: center;
        font-size: 0.85rem;
    }

    .properties-table {
        min-width: 800px;
    }

    .properties-table th,
    .properties-table td {
        padding: 0.65rem 0.5rem;
        font-size: 0.8rem;
    }

    .table-pagination {
        gap: 0.35rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .pagination-btn span {
        display: none;
    }

    .page-number {
        min-width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .properties-table-section {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .properties-table {
        min-width: 700px;
    }

    .properties-table th,
    .properties-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.6rem;
    }

    .page-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

/* CSP Compliant Styles - Replacing inline styles */
.loading-cell {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    font-size: 2rem;
    color: #60a5fa;
}

.location-icon {
    color: #ef4444;
    margin-left: 0.35rem;
}

/* Purple theme for pagination buttons on main page */
body:not(.dashboard-page) .pagination-btn {
    background: white !important;
    color: #8b5cf6 !important;
    border: 2px solid #8b5cf6 !important;
}

body:not(.dashboard-page) .pagination-btn:hover:not(:disabled) {
    background: #8b5cf6 !important;
    color: white !important;
    border-color: #8b5cf6 !important;
}

body:not(.dashboard-page) .pagination-btn.active,
body:not(.dashboard-page) .page-number.active {
    background: #7c3aed !important;
    color: white !important;
    border-color: #7c3aed !important;
}

body:not(.dashboard-page) .page-number {
    background: white !important;
    color: #8b5cf6 !important;
    border: 2px solid #8b5cf6 !important;
}

body:not(.dashboard-page) .page-number:hover:not(.active) {
    background: #8b5cf6 !important;
    color: white !important;
    border-color: #8b5cf6 !important;
}
