/* Customers List Specific Styles */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    gap: 10px;
}

.filters-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: var(--radius);
}

.search-container {
    display: flex;
    gap: 10px;
    flex: 1;
    align-items: center; /* Add this to align items vertically */
}

.search-container .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Fix search button size and alignment */
.search-container button {
    height: 36px; /* Match the height of the input */
    padding: 0 15px; /* Adjust padding to make it narrower */
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-options {
    display: flex;
    gap: 15px;
}

.customers-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#customersTable {
    width: 100%;
    border-collapse: collapse;
}

#customersTable th {
    position: sticky;
    top: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 15px;
    text-align: left;
}

#customersTable td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

#customersTable tr:nth-child(even) {
    background-color: var(--light-bg);
}

#customersTable tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

.status-completed {
    background-color: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

.status-overdue {
    background-color: rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-action {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-view {
    background-color: #3498db;
    color: white;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-print {
    background-color: #2ecc71;
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 40px;
}

#pageInfo {
    font-size: 16px;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #777;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 80%;
    max-width: 600px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

/* Navbar fixes - ensure it's always styled correctly */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 20px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-logo h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 10px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* RTL Support */
body.urdu .page-header,
body.urdu .page-actions,
body.urdu .filters-bar,
body.urdu .search-container,
body.urdu .filter-options,
body.urdu .action-buttons {
    flex-direction: row-reverse;
}

body.urdu #customersTable th,
body.urdu #customersTable td {
    text-align: right;
}

/* Print Styles */
@media print {
    .page-actions,
    .filters-bar,
    .pagination,
    .action-buttons,
    .modal {
        display: none !important;
    }
    
    .customers-table-container {
        box-shadow: none;
        overflow: visible;
    }
    
    #customersTable th {
        background-color: #eee !important;
        color: black !important;
    }
    
    body, html {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    
    #customersTable {
        width: 100% !important;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .filters-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-options {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .filter-options {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links li {
        margin: 0;
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 15px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Make sure the navbar doesn't lose styling on refresh */
@media screen {
    header, .navbar {
        visibility: visible !important;
        display: block !important;
    }
}