/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;700&family=Noto+Nastaliq+Urdu:wght@400;500;700&display=swap');

:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
    line-height: 1.6;
}
.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);
}


/* Mobile Navbar Styles */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        display: none !important; /* Initially hidden on mobile */
        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 !important; /* Show when toggled */
    }
    
    .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);
    }
    
    body.urdu .nav-links {
        right: 0;
        left: auto;
    }
}

/* Search Container Styles */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    align-items: center; /* Align items vertically */
}

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

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

/* Responsive search container */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container button {
        margin-top: 10px;
        width: 100%;
    }
}

/* 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;
    }
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Language Control */
.en {
    display: block;
}

.ur {
    display: none;
    font-family: 'Noto Nastaliq Urdu', serif;
}

body.urdu .en {
    display: none;
}

body.urdu .ur {
    display: block;
}

body.urdu {
    direction: rtl;
    text-align: right;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

#company-logo {
    height: 50px;
    max-width: 150px;
    margin-right: 15px;
}

.title-container {
    flex: 1;
}

header h1 {
    color: var(--primary-color);
    font-size: 28px;
}

.language-toggle button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

body.urdu #company-logo {
    margin-right: 0;
    margin-left: 15px;
}

.language-toggle button:hover {
    background-color: var(--secondary-color);
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-color);
    opacity: 0.7;
    transition: var(--transition);
}

.tab-btn.active {
    border-bottom: 3px solid var(--primary-color);
    opacity: 1;
    font-weight: bold;
}

.tab-content {
    display: none;
    background-color: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tab-content.active {
    display: block;
}

/* Item Selection Grid */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.item-card {
    background-color: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.item-image {
    height: 150px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image.placeholder {
    background-color: #f0f0f0;
}

.item-card h3 {
    padding: 15px;
    font-size: 16px;
    text-align: center;
}

.item-card .price {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

/* Selected Item Details */
.selected-item-details {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.back-button {
    margin-bottom: 20px;
}

.back-button button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-button button:hover {
    text-decoration: underline;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.form-group input[readonly] {
    background-color: var(--light-bg);
    cursor: not-allowed;
}

h2, h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    margin-top: 30px;
    border-bottom: none;
    padding-bottom: 5px;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

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

/* Search Results */
.search-results {
    margin-top: 20px;
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--light-bg);
}

.search-result-item.selected {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 4px solid var(--primary-color);
}

.search-result-item h4 {
    margin-bottom: 5px;
    color: var(--text-color);
}

.search-result-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Detail View */
.detail-view {
    display: none;
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.detail-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-label {
    font-weight: bold;
    flex: 0 0 150px;
}

.detail-value {
    flex: 1;
}

/* Payment History */
.payment-history {
    margin-bottom: 30px;
}

.payment-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--light-bg);
    font-weight: bold;
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-good {
    background-color: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
}

.status-late {
    background-color: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
}

/* Buttons */
.form-buttons {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.btn-primary, 
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #f1f1f1;
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #e1e1e1;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

body.urdu .form-buttons {
    flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
        padding: 15px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .form-group input,
    .form-group select {
        font-size: 14px;
    }
    
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        display: none !important; /* Initially hidden on mobile */
        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 !important; /* Show when toggled */
    }
    
    .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);
    }
    
    /* Center search button on mobile */
    .search-container {
        flex-direction: column;
    }
    
    .search-container button {
        align-self: flex-start;
        margin-top: 10px;
    }
}
/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    
    header, .tabs, .search-container, .form-buttons, button {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
        box-shadow: none;
        padding: 0;
    }
    
    table {
        border: 1px solid #ddd;
    }
    
    th, td {
        border: 1px solid #ddd;
    }
    
}
