/**********************************************************
*
* 応募者管理
*
**********************************************************/

/** Applicants count **/
.applicants-count {
    background-color: red;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 8px;
    right: 20px;
}

.nav-item {
    position: relative;
}

.action-apply {
    min-width: 118px;
    text-align: center;
}

.apply-hide-checkbox {
    width: 14px;
    height: 14px;
    transform: scale(1.5);
}

.button_hide_label {
    background-color: #607d8b !important;
    border-color: #607d8b !important;
    color: white !important;
}

/* Stale application background */
.stale-application {
    background-color: #ffebee !important;
}

.stale-application .button_hide_label {
    background-color: #607d8b !important;
    border-color: #607d8b !important;
    color: white !important;
}

.stale-application:hover {
    background-color: #f5d8db !important;
}

/* Apply opacity only to the table row, not its contents */
.restricted-application {
    position: relative;
}

/* Apply overlay to ALL columns for restricted applications */
.restricted-application > td::before {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0.8;
    z-index: 1;
}

/* Hide empty button spans that cause visual artifacts */
.restricted-application td span.btn:empty,
.stale-application td span.btn:empty {
    display: none !important;
}

/* Additional specificity for empty spans with button classes */
.restricted-application td span[class*='btn']:empty,
.stale-application td span[class*='btn']:empty {
    display: none !important;
}

.restricted-application > td a {
    color: #888 !important;
}

/* Make sure the restricted message and its contents are fully visible */
.restricted-message > span {
    opacity: 1 !important;
    color: red !important;
    font-size: 14px;
    letter-spacing: 0.2em;
}

.restricted-message > i {
    opacity: 1 !important;
    color: #ffc107 !important;
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 14px;
    position: relative;
}

.restricted-message > i::after {
    content: '!';
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000 !important;
    font-weight: 800;
    font-size: 0.8em;
    font-family: Arial, sans-serif;
    z-index: 2;
}

.restricted-application button,
.restricted-application input[type='submit'],
.restricted-application a {
    pointer-events: none;
    cursor: not-allowed;
}

.restricted-application td {
    position: relative;
}

/* restore original behavior: span across columns from the first cell */
.restricted-message {
    padding: 10px 15px;
    font-weight: bold;
    position: absolute;
    z-index: 888;
    top: 50%;
    left: 50px;
    width: 1480px;
    transform: translateY(-50%);
    pointer-events: auto;
    text-align: center;
    opacity: 1 !important;
    overflow-wrap: break-word;
}

/* Ensure proper table structure */
.table {
    position: relative;
    table-layout: auto;
    width: 100%;
}

/* Fix table cell alignment */
.table td {
    vertical-align: middle !important;
    position: relative;
}

/* Ensure proper stacking context */
.table-responsive {
    position: relative;
    overflow-x: hidden;
}

/* Ensure proper stacking context */
.table > tbody > tr {
    position: relative;
}

/* Ensure proper table structure */
.table > tbody > tr > td {
    vertical-align: middle;
}

/* Fix checkbox alignment */
.css-control-input {
    margin: 0;
    vertical-align: middle;
}

/* Hover effect for all rows except restricted ones */
table tr:not(.restricted-application):hover {
    background-color: #f5f5f5;
}

table {
    table-layout: auto;
    width: 100%;
}

.table-head-fixed thead tr {
    position: relative;
    z-index: 999 !important;
}

/**********************************************************
* Responsive Design
**********************************************************/
@media (max-width: 1280px) {
    .restricted-message {
        font-size: 12px;
        padding: 6px 8px;
        width: calc(100vw - 60px);
        max-width: 1100px;
        white-space: normal;
        word-wrap: break-word;
    }

    .table td {
        font-size: 12px;
        padding: 5px 3px;
        min-width: 50px;
    }

    .table th {
        font-size: 12px;
        padding: 5px 3px;
    }

    .action-apply {
        font-size: 11px;
        min-width: 110px;
        padding: 4px 6px;
    }

    .apply-hide-checkbox {
        transform: scale(1);
    }

    .applicants-count {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: 4px;
        right: 12px;
    }

    table {
        font-size: 12px;
    }

    .table td,
    .table th {
        white-space: nowrap !important;
        min-width: 50px;
    }

    table td {
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .table-head-fixed thead tr {
        position: relative;
        z-index: 999 !important;
    }
}

@media (max-width: 1024px) {
    .restricted-message {
        font-size: 12px;
        padding: 6px 8px;
        width: calc(100vw - 40px);
        max-width: 900px;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .applicants-count {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: 6px;
        right: 15px;
    }

    .action-apply {
        min-width: 120px;
        font-size: 12px;
    }

    .stale-application td,
    .restricted-application td {
        border: 1px solid #dee2e6 !important;
    }

    .table td,
    .table th {
        white-space: nowrap !important;
        min-width: 50px;
    }

    table td {
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    table {
        table-layout: auto;
        width: 100%;
    }

    .table-head-fixed thead tr {
        position: relative;
        z-index: 999 !important;
    }
}

@media (max-width: 820px) {
    .restricted-message {
        font-size: 12px;
        padding: 6px 8px;
        width: calc(100vw - 40px);
        max-width: none;
        left: 100%;
    }

    .table td {
        font-size: 12px;
        padding: 6px;
        min-width: 50px;
    }

    .action-apply {
        min-width: 120px;
        font-size: 12px;
    }

    .apply-hide-checkbox {
        transform: scale(1.2);
    }

    .applicants-count {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: 5px;
        right: 10px;
    }

    table {
        width: 100%;
        table-layout: fixed;
    }

    .table td,
    .table th {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .table-head-fixed thead tr {
        position: relative;
        z-index: 999 !important;
    }
}

@media (max-width: 768px) {
    .restricted-message {
        font-size: 12px;
        padding: 6px 8px;
        width: calc(100vw - 40px);
        max-width: 1000px;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .table td {
        font-size: 12px;
        padding: 6px;
        min-width: 50px;
    }

    .action-apply {
        min-width: auto;
        font-size: 12px;
    }

    .apply-hide-checkbox {
        transform: scale(1.2);
    }

    .applicants-count {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: 5px;
        right: 10px;
    }

    table {
        width: 100%;
        table-layout: fixed;
    }

    .table td,
    .table th {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .table-head-fixed thead tr {
        position: relative;
        z-index: 999 !important;
    }
}

@media (max-width: 480px) {
    .restricted-message {
        font-size: 11px;
        padding: 5px;
        width: calc(100vw - 20px);
        max-width: 1100px;
        left: 50%;
        transform: translate(-50%, -50%);
        white-space: normal;
        word-wrap: break-word;
    }

    .table td {
        font-size: 11px;
        padding: 4px 2px;
        min-width: 40px;
    }

    .table th {
        font-size: 11px;
        padding: 4px 2px;
    }

    .action-apply {
        font-size: 11px;
        min-width: 60px;
    }

    .apply-hide-checkbox {
        transform: scale(0.9);
    }

    .applicants-count {
        width: 16px;
        height: 16px;
        font-size: 9px;
        top: 3px;
        right: 8px;
    }

    table {
        font-size: 11px;
    }

    .table-head-fixed thead tr {
        position: relative;
        z-index: 999 !important;
    }
}
