/* HK Jobs Web Server - Styles */

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

:root {
    --primary-color: #1e40af;
    --secondary-color: #0f766e;
    --accent-color: #dc2626;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --hkex-color: #e74c3c;
    --hkjc-color: #3498db;
    --bochk-color: #9b59b6;
    --hkclp-color: #e67e22;
    --hkmtr-color: #16a34a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Stats Section */
.stats-section {
    display: none;  /* Hidden - replaced with pagination */
}

/* Filter Section */
.filter-section {
    display: none;  /* Hidden - filter functionality replaced */
}

/* Search Section */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-container {
    margin-bottom: 20px;
}

.search-box {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.filter-section h2 {
    display: none;
}

.filter-buttons {
    display: none;
}

.btn {
    padding: 10px 20px;
    background-color: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #1e3a8a;
}

/* Jobs Section */
.jobs-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.jobs-section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Table */
.jobs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.jobs-table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.jobs-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jobs-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.jobs-table tbody tr:hover {
    background-color: var(--light-bg);
    transition: background-color 0.2s ease;
}

.job-title {
    font-weight: 500;
    color: var(--primary-color);
    max-width: 300px;
    word-wrap: break-word;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-hkex {
    background-color: #fee2e2;
    color: var(--hkex-color);
}

.badge-hkjc {
    background-color: #dbeafe;
    color: var(--hkjc-color);
}

.badge-bochk {
    background-color: #f3e8ff;
    color: var(--bochk-color);
}

.badge-hkclp {
    background-color: #fed7aa;
    color: var(--hkclp-color);
}

.badge-hkmtr {
    background-color: #dcfce7;
    color: var(--hkmtr-color);
}

.badge-default {
    background-color: #f0f0f0;
    color: var(--text-dark);
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.text-muted.small {
    font-size: 0.85em;
}

.small {
    font-size: 0.85em;
}

/* Pagination Section */
.pagination-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.pagination-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
}

.pagination-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95em;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.1em;
    margin: 10px 0;
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1em;
}

.error {
    background-color: #fee2e2;
    color: var(--hkex-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--hkex-color);
    margin: 20px 0;
}

.error p {
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .jobs-table {
        font-size: 0.9em;
    }
    
    .jobs-table th,
    .jobs-table td {
        padding: 10px;
    }
    
    .job-title {
        max-width: 150px;
    }
    
    .container {
        padding: 10px;
    }
    
    .jobs-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    
    header {
        padding: 20px 10px;
    }
    
    .jobs-table {
        font-size: 0.8em;
    }
    
    .jobs-table th,
    .jobs-table td {
        padding: 8px 5px;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 0.75em;
    }
}



/* Loading and Error States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1em;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.error p {
    margin: 0;
    font-size: 1em;
}

@media (max-width: 768px) {
    .jobs-table {
        font-size: 0.9em;
    }

    .jobs-table th,
    .jobs-table td {
        padding: 10px;
    }
    
    .job-title {
        max-width: 150px;
    }
}
