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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.5;
}

header {
    background: #1a365d;
    color: white;
    padding: 1.5rem 2rem;
    position: relative;
}

.header-link {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #a0c4ff;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid rgba(160, 196, 255, 0.5);
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
}

.header-link:hover {
    background: rgba(160, 196, 255, 0.15);
    color: white;
}

header h1 {
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.subtitle {
    color: #a0c4ff;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Controls */
.controls {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    margin-bottom: 0.75rem;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    outline: none;
}

.search-bar input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.15);
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
    min-width: 140px;
}

.filter-group select[multiple] {
    height: 60px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.actions button {
    padding: 0.4rem 1rem;
    background: #2b6cb0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.actions button:hover {
    background: #2c5282;
}

#resultCount {
    font-size: 0.85rem;
    color: #718096;
}

/* Table */
#jobTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.88rem;
}

#jobTable thead {
    background: #edf2f7;
    position: sticky;
    top: 160px;
    z-index: 5;
}

#jobTable th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #cbd5e0;
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    color: #2b6cb0;
}

th.sort-active::after {
    margin-left: 4px;
}

th.sort-asc::after {
    content: " \25B2";
}

th.sort-desc::after {
    content: " \25BC";
}

#jobTable td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}

#jobTable tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

#jobTable tbody tr:hover {
    background: #f0f7ff;
}

/* Row status colors */
tr.expiring-soon td {
    background: #fff5f5;
}

tr.expired td {
    background: #f7f7f7;
    color: #a0aec0;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    margin: 1px;
    background: #e2e8f0;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #4a5568;
}

.tag-cyber { background: #fed7d7; color: #9b2c2c; }
.tag-data { background: #c6f6d5; color: #276749; }
.tag-software { background: #bee3f8; color: #2a4365; }
.tag-cloud { background: #e9d8fd; color: #553c9a; }
.tag-devops { background: #fefcbf; color: #744210; }
.tag-ai { background: #fbd38d; color: #7b341e; }
.tag-networking { background: #b2f5ea; color: #285e61; }
.tag-architecture { background: #fed7e2; color: #97266d; }
.tag-it { background: #e2e8f0; color: #2d3748; }
.tag-telecom { background: #d6f0ff; color: #21597a; }
.tag-digital { background: #e6e0ff; color: #44337a; }

/* Link column */
.job-link {
    color: #2b6cb0;
    text-decoration: none;
    font-size: 0.85rem;
}

.job-link:hover {
    text-decoration: underline;
}

/* Loading & empty states */
#loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.1rem;
}

#noResults {
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    padding: 1rem 2rem;
    text-align: center;
    color: #a0aec0;
    font-size: 0.8rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
}

.modal-close:hover {
    color: #2d3748;
}

.modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.modal-meta span {
    background: #edf2f7;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

#modalTags {
    margin-bottom: 1rem;
}

#modalDescription {
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

#modalLink {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #2b6cb0;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

#modalLink:hover {
    background: #2c5282;
}

/* Responsive */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    #jobTable {
        font-size: 0.8rem;
    }

    header {
        padding: 1rem;
    }

    .header-link {
        position: static;
        display: inline-block;
        margin-top: 0.75rem;
    }

    .controls {
        padding: 0.75rem 1rem;
    }
}
