/* ================================
   MY JOBS - JOB PORTAL
   Main Stylesheet
================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3157d5;
    --primary-dark: #2342ad;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;

    --dark: #172033;
    --text: #334155;
    --muted: #64748b;

    --background: #f4f7fb;
    --white: #ffffff;
    --border: #e2e8f0;

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.07);

    --radius: 14px;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}


/* ================================
   TOP BAR
================================ */

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);

    min-height: 78px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 5%;

    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: white;
    background:
        linear-gradient(
            135deg,
            #3157d5,
            #673ab7
        );

    font-weight: 800;
    font-size: 17px;

    box-shadow:
        0 6px 16px rgba(49, 87, 213, 0.25);
}

.brand h1 {
    font-size: 23px;
    color: var(--dark);
    line-height: 1.1;
}

.brand span {
    font-size: 12px;
    color: var(--muted);
}

.header-actions {
    display: flex;
    gap: 10px;
}


/* ================================
   BUTTONS
================================ */

.btn {
    border: none;
    border-radius: 9px;

    padding: 10px 16px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: white;
    background: var(--primary);

    box-shadow:
        0 5px 15px rgba(49, 87, 213, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    color: var(--text);
    background: #eef2f7;
}

.btn-outline {
    color: var(--primary);
    background: white;
    border: 1px solid #cbd5e1;
}

.btn-danger {
    color: white;
    background: var(--danger);
}


/* ================================
   MAIN CONTAINER
================================ */

.container {
    width: min(1450px, 90%);
    margin: 30px auto 50px;
}


/* ================================
   DASHBOARD
================================ */

.dashboard {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

    margin-bottom: 22px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 20px;

    display: flex;
    align-items: center;

    gap: 15px;

    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
}

.stat-icon.blue {
    background: #e8efff;
}

.stat-icon.green {
    background: #e8f8ed;
}

.stat-icon.orange {
    background: #fff3dc;
}

.stat-icon.purple {
    background: #f1eaff;
}

.stat-card span {
    display: block;

    color: var(--muted);
    font-size: 13px;

    margin-bottom: 4px;
}

.stat-card strong {
    color: var(--dark);
    font-size: 23px;
}


/* ================================
   TOOLBAR
================================ */

.toolbar {
    background: white;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    max-width: 650px;

    height: 44px;

    display: flex;
    align-items: center;

    gap: 9px;

    background: #f8fafc;

    border: 1px solid var(--border);
    border-radius: 9px;

    padding: 0 14px;
}

.search-box span {
    font-size: 17px;
}

.search-box input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;

    font-size: 14px;
}


/* ================================
   TABLE CARD
================================ */

.table-card {
    background: white;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.table-header {
    padding: 20px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.table-header h2 {
    color: var(--dark);
    font-size: 19px;

    margin-bottom: 4px;
}

.table-header p {
    color: var(--muted);
    font-size: 13px;
}

.job-count {
    background: #edf2ff;
    color: var(--primary);

    padding: 7px 12px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;
}


/* ================================
   TABLE
================================ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;

    min-width: 850px;
}

thead {
    background: #f8fafc;
}

th {
    text-align: left;

    padding: 14px 16px;

    color: #475569;

    font-size: 12px;

    text-transform: uppercase;
    letter-spacing: 0.04em;

    white-space: nowrap;

    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px;

    border-bottom: 1px solid #edf1f5;

    font-size: 13px;

    vertical-align: middle;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fbff;
}

tbody tr:last-child td {
    border-bottom: none;
}


/* ================================
   TABLE CONTENT
================================ */

.post-name {
    color: var(--dark);
    font-weight: 700;
}

.organization {
    color: var(--text);
    font-weight: 600;
}

.vacancy {
    color: var(--primary);
    font-weight: 700;
}

.date {
    white-space: nowrap;
}

.deadline {
    color: #b45309;
    font-weight: 600;
}

.deadline.expired {
    color: var(--danger);
}

.deadline.active {
    color: var(--success);
}

.action-buttons {
    display: flex;
    gap: 7px;
}

.icon-btn {
    width: 34px;
    height: 34px;

    border: 1px solid var(--border);

    background: white;

    border-radius: 8px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.15s;
}

.icon-btn:hover {
    background: #f1f5f9;
}

.icon-btn.delete:hover {
    color: var(--danger);
    border-color: #fecaca;
    background: #fff1f2;
}


/* ================================
   EMPTY STATE
================================ */

.empty-state {
    display: none;

    padding: 65px 20px;

    text-align: center;
}

.empty-state.visible {
    display: block;
}

.empty-icon {
    font-size: 48px;

    margin-bottom: 12px;
}

.empty-state h3 {
    color: var(--dark);

    margin-bottom: 6px;
}

.empty-state p {
    color: var(--muted);

    margin-bottom: 20px;
}


/* ================================
   MODALS
================================ */

.modal-overlay {
    position: fixed;

    inset: 0;

    background:
        rgba(15, 23, 42, 0.55);

    backdrop-filter: blur(4px);

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: min(700px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    background: white;

    border-radius: 16px;

    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.25);

    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 22px;

    border-bottom: 1px solid var(--border);

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-header h2 {
    color: var(--dark);
    font-size: 19px;
}

.modal-header p {
    color: var(--muted);
    font-size: 12px;

    margin-top: 4px;
}

.close-btn {
    border: none;
    background: transparent;

    font-size: 28px;

    color: var(--muted);

    cursor: pointer;

    line-height: 1;
}

.close-btn:hover {
    color: var(--dark);
}


/* ================================
   FORM
================================ */

.form-grid {
    padding: 22px;

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    color: var(--dark);

    font-size: 13px;
    font-weight: 700;
}

.form-group input,
.form-group select {
    height: 43px;

    border: 1px solid #cbd5e1;

    border-radius: 8px;

    padding: 0 12px;

    outline: none;

    font-size: 13px;

    color: var(--text);

    background: white;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(49, 87, 213, 0.1);
}

.modal-footer {
    padding: 15px 22px;

    border-top: 1px solid var(--border);

    display: flex;

    justify-content: flex-end;

    gap: 10px;
}


/* ================================
   COLUMN MANAGER
================================ */

.column-modal {
    width: min(600px, 100%);
}

.add-column-box {
    padding: 20px;

    display: flex;

    gap: 10px;

    border-bottom: 1px solid var(--border);
}

.add-column-box input {
    flex: 1;

    height: 43px;

    border: 1px solid #cbd5e1;

    border-radius: 8px;

    padding: 0 12px;

    outline: none;
}

.add-column-box input:focus {
    border-color: var(--primary);
}

.column-list {
    padding: 10px 20px;
}

.column-item {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 12px 0;

    border-bottom: 1px solid #edf1f5;
}

.column-item:last-child {
    border-bottom: none;
}

.column-info {
    display: flex;
    align-items: center;

    gap: 10px;
}

.column-number {
    width: 28px;
    height: 28px;

    background: #edf2ff;
    color: var(--primary);

    border-radius: 7px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;
}

.locked {
    font-size: 11px;
    color: var(--muted);
}

.remove-column {
    border: none;

    background: #fff1f2;

    color: var(--danger);

    border-radius: 7px;

    padding: 7px 10px;

    cursor: pointer;
}

.remove-column:disabled {
    opacity: 0.35;

    cursor: not-allowed;
}


/* ================================
   CONFIRM MODAL
================================ */

.small-modal {
    width: min(420px, 100%);

    padding: 28px;

    text-align: center;
}

.small-modal .modal-footer {
    border: none;

    padding: 20px 0 0;

    justify-content: center;
}

.confirm-icon {
    font-size: 40px;

    margin-bottom: 12px;
}

.small-modal h2 {
    color: var(--dark);

    margin-bottom: 8px;
}

.small-modal p {
    color: var(--muted);

    font-size: 14px;
}


/* ================================
   TOAST
================================ */

.toast {
    position: fixed;

    right: 25px;
    bottom: 25px;

    background: #172033;
    color: white;

    padding: 13px 18px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.2);

    transform: translateY(100px);

    opacity: 0;

    pointer-events: none;

    transition: 0.25s;

    z-index: 200;
}

.toast.show {
    transform: translateY(0);

    opacity: 1;
}


/* ================================
   FOOTER
================================ */

footer {
    text-align: center;

    color: var(--muted);

    font-size: 12px;

    padding: 25px 15px 35px;
}


/* ================================
   RESPONSIVE DESIGN
================================ */

@media (max-width: 1000px) {

    .dashboard {
        grid-template-columns:
            repeat(2, 1fr);
    }

}

@media (max-width: 700px) {

    .topbar {
        position: static;

        flex-direction: column;

        align-items: stretch;

        gap: 15px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    .container {
        width: 94%;

        margin-top: 20px;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .table-header {
        align-items: flex-start;

        gap: 10px;
    }

    .add-column-box {
        flex-direction: column;
    }

    .brand h1 {
        font-size: 21px;
    }

}

@media (max-width: 450px) {

    .header-actions {
        flex-direction: column;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-header,
    .form-grid {
        padding: 17px;
    }

    .modal-footer {
        padding: 13px 17px;
    }

    .toast {
        left: 15px;
        right: 15px;
        bottom: 15px;

        text-align: center;
    }

}