/* Login Styles */
.login-container {
    background: #ebd19a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    border: 2px solid rgba(0,0,0,0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: black;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: black;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: #dfb35a;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #007bff;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #c82333;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.dashboard-card p {
    color: #666;
    margin-bottom: 10px;
}

.count-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
}

.tables-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.back-button:hover {
    background: #545b62;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #333;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.dashboard-card p {
    color: #666;
    margin-bottom: 10px;
}

.count-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background:  #daa851 !important;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
}

.count-badge.loading {
    background: #b8860b !important; /* Darker gold for loading state */
}

.tables-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.back-button:hover {
    background: #545b62;
}

/* Admin Dashboard Styles */
.dashboard {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #007bff;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
}

.actions-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #0056b3;
}

#tablesContainer {
    display: none;
    margin-top: 20px;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.back-button:hover {
    background: #545b62;
}

.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.message-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-small {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 2px;
}

.btn-small.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #c82333;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.contact-details {
    margin: 20px 0;
}

.message-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    white-space: pre-wrap;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 15px;
}

.logout-btn:hover {
    background: #c82333;
}

.detail-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.detail-section h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1rem;
}

.detail-section p {
    margin: 5px 0;
    padding: 2px 0;
}

.detail-section strong {
    color: #555;
    min-width: 160px;
    display: inline-block;
}

/* Add these styles to your existing styles.css */
/* Add these styles to your existing styles.css */

/* Table Controls */
/* Add this to your existing styles.css file */

/* Table Controls */
.table-controls {
    margin-bottom: 25px;
    padding-top: 15px;
    border-top: 1px solid #bdc3c7;
}

.search-box {
    display: flex !important;
    max-width: 500px;
    margin-top: 10px;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 12px 15px 12px 45px;
    border: 2px solid #bdc3c7;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    border-right: none;
}

.search-box input:focus {
    outline: none;
    border-color: black;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 1.1rem;
    z-index: 2;
}

.search-button {
    padding: 12px 25px !important;
    background: #daa851 !important;
    color: white !important;
    border: 2px solid #daa851 !important;
    border-radius: 0 6px 6px 0 !important;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
    display: block !important;
    visibility: visible !important;
}

.search-button:hover {
    background:  #a87c2d !important;
    border-color: #a87c2d  !important;
    transform: translateY(-1px);
}

/* Enhanced Table Styling - FIXED HEADERS */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e1e1;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid #e1e1e1;
}

/* FIXED: Table headers with proper colors */
.data-table th {
    background: #daa851 !important;
    color: white !important;
    font-weight: 500;
    border-bottom: 3px solid black;
    font-size: 1rem;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: #e3f2fd;
}

.data-table td {
    border-bottom: 1px solid #e1e1e1;
    color: #333;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #bdc3c7;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.pagination button:hover:not(:disabled) {
    background: #ecf0f1;
    border-color: #daa851;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    margin: 0 15px;
    font-size: 0.9rem;
    color: #34495e;
    font-weight: 500;
}

/* Remove back button */
.back-button {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* Responsive Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table {
    min-width: 800px; /* Minimum width before scrolling kicks in */
    width: 100%;
    border-collapse: collapse;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .tables-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-box input {
        padding: 10px 10px 10px 40px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pagination button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .page-info {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }
    
    /* Mobile table cell styles */
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .btn-small {
        padding: 6px 8px;
        font-size: 12px;
        margin: 1px;
    }
    
    /* Back button mobile styling */
    .back-to-dashboard-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
        margin-bottom: 15px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .admin-container {
        padding: 5px;
    }
    
    .tables-container {
        padding: 10px;
    }
    
    .data-table {
        min-width: 900px; /* Slightly larger for very small screens */
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .card-icon {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.3rem;
        text-align: center;
    }
}

/* Modal responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 20px;
    }
    
    .detail-section {
        padding: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Touch-friendly improvements */
.btn-small, 
.pagination button, 
.search-button {
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
}

.dashboard-card {
    min-height: 120px; /* Better touch targets */
}

/* Horizontal scroll indicator for tables */
.table-container {
    position: relative;
}

.table-container::after {
    content: "← Scroll →";
    position: absolute;
    top: -25px;
    right: 10px;
    background: #daa851;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
}

@media (max-width: 768px) {
    .table-container::after {
        display: block;
    }
}

/* Improved mobile header */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .logout-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Better mobile table actions */
@media (max-width: 768px) {
    .data-table td:last-child {
        position: sticky;
        right: 0;
        background: white;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }
}


.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo-image {
    height: 80px; /* Bigger size */
    width: auto;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}


/* Loading animation styles */
.loading-dots {
    display: inline-block;
    color: white !important;
    font-size: 0.8em;
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
	color: white !important;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}


.count-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    min-width: 40px;
    text-align: center;
}


/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 200px;
}

.skeleton-search {
    height: 40px;
    width: 100%;
}

.skeleton-header {
    height: 20px;
    width: 80%;
    margin: 0 auto;
}

.skeleton-cell {
    height: 16px;
    width: 90%;
    margin: 4px auto;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #daa851;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}