﻿/* Final overrides for registration list responsive behavior */

.registration-v2-page .registered-table-wrapper {
    overflow-x: hidden;
}

.registration-v2-page .registered-table {
    width: 100%;
    table-layout: fixed;
}

.registration-v2-page .registered-table .td-code,
.registration-v2-page .registered-table th:nth-child(1) {
    width: 50px;
    max-width: 50px;
}

.registration-v2-page .registered-table .td-players,
.registration-v2-page .registered-table th:nth-child(2) {
    width: 42%;
    min-width: 0;
    max-width: none;
}

.registration-v2-page .registered-table .td-team-total,
.registration-v2-page .registered-table th:nth-child(3) {
    width: 110px;
}

.registration-v2-page .registered-table .td-date,
.registration-v2-page .registered-table th:nth-child(4) {
    width: 130px;
}

.registration-v2-page .registered-table .td-review-status,
.registration-v2-page .registered-table .td-fee-status,
.registration-v2-page .registered-table th:nth-child(5),
.registration-v2-page .registered-table th:nth-child(6) {
    width: 160px;
}

.registration-v2-page .registered-table .td-paid-time,
.registration-v2-page .registered-table th:nth-child(7) {
    width: 110px;
}

.registration-v2-page .registered-table .td-actions,
.registration-v2-page .registered-table th:nth-child(8) {
    width: 54px;
    text-align: center;
}

.registration-v2-page .players-inline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.registration-v2-page .player-inline-name {
    font-size: 11px;
}

.registration-v2-page .player-inline-meta {
    gap: 7px;
    font-size: 10px;
}

.registration-v2-page .mobile-card-header,
.registration-v2-page .mobile-card-fee {
    display: none;
}

.registration-v2-page .status-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.registration-v2-page .status-display.approval-approved {
    background: rgba(76, 175, 80, 0.14);
    border-color: rgba(76, 175, 80, 0.45);
    color: #7ee787;
}

.registration-v2-page .status-display.approval-rejected {
    background: rgba(244, 67, 54, 0.14);
    border-color: rgba(244, 67, 54, 0.45);
    color: #ff8b8b;
}

.registration-v2-page .status-display.approval-pending {
    background: rgba(246, 201, 101, 0.12);
    border-color: rgba(246, 201, 101, 0.4);
    color: #f6c965;
}

.registration-v2-page .status-display.payment-paid {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.45);
    color: #38bdf8;
}

.registration-v2-page .status-display.payment-unpaid {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.registration-v2-page .action-menu {
    position: relative;
    display: inline-block;
}

.registration-v2-page .action-menu-toggle {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
}

.registration-v2-page .action-menu-toggle:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.registration-v2-page .action-menu-list {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    min-width: 170px;
    background: #11161f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.registration-v2-page .action-menu-list.open {
    display: block;
}

/* Scoped to the kebab dropdown only — the inline row-action buttons also carry
   `.action-menu-item` (JS hook) and are styled by `.reg-action-stack-btn`. */
.registration-v2-page .action-menu-list .action-menu-item {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

.registration-v2-page .action-menu-list .action-menu-item:hover {
    background: rgba(158, 255, 0, 0.1);
    color: var(--text-primary);
}

.registration-v2-page .status-summary-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 14px;
}

.registration-v2-page .status-summary-btn {
    flex: 1 1 0;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.registration-v2-page .status-summary-btn span {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 1px 6px;
    margin-left: 4px;
    font-size: 11px;
}

.registration-v2-page .status-summary-btn.active {
    border-color: rgba(158,255,0,0.6);
    color: var(--primary-green);
    background: rgba(158,255,0,0.08);
}

.registration-v2-page .status-summary-btn.active span {
    background: rgba(158,255,0,0.2);
}

@media (max-width: 400px) {
    .registration-v2-page .status-summary-btn {
        font-size: 10px;
        padding: 7px 2px;
    }
    .registration-v2-page .status-summary-btn span {
        margin-left: 2px;
        padding: 1px 4px;
        font-size: 10px;
    }
}

@media (max-width: 414px) {
    .registration-v2-page .status-summary-bar {
        gap: 4px;
    }

    .registration-v2-page .status-summary-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 1px;
        font-size: 9px;
        line-height: 1.05;
        white-space: normal;
        overflow: hidden;
    }

    .registration-v2-page .status-summary-btn span {
        margin-left: 0;
        padding: 1px 4px;
        font-size: 9px;
        line-height: 1;
    }
}

@media (max-width: 360px) {
    .registration-v2-page .status-summary-bar {
        gap: 3px;
    }

    .registration-v2-page .status-summary-btn {
        padding: 5px 1px;
        font-size: 8px;
    }

    .registration-v2-page .status-summary-btn span {
        padding: 1px 3px;
        font-size: 8px;
    }
}

@media (max-width: 414px) {
    .registration-v2-page .player-submit-section {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between;
        align-items: stretch;
        gap: 8px;
    }

    .registration-v2-page .player-submit-section .btn-cancel,
    .registration-v2-page .player-submit-section .btn-submit {
        width: calc(50% - 4px) !important;
        justify-content: center;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .registration-v2-page .player-submit-section {
        gap: 6px;
    }

    .registration-v2-page .player-submit-section .btn-cancel,
    .registration-v2-page .player-submit-section .btn-submit {
        width: calc(50% - 3px) !important;
    }
}

/* Hide mobile-only card elements on desktop */
.registration-v2-page .mobile-card-header,
.registration-v2-page .mobile-player-row,
.registration-v2-page .mobile-card-dates,
.registration-v2-page .mobile-card-actions {
    display: none;
}

@media (min-width: 768px) and (max-width: 1366px) {
    .registration-v2-page .registered-table th,
    .registration-v2-page .registered-table td {
        padding: 7px 6px;
        font-size: 10px;
    }

    .registration-v2-page .player-inline-avatar .avatar-img {
        width: 34px;
        height: 34px;
    }

    .registration-v2-page .player-inline {
        gap: 6px;
        min-height: 38px;
    }

    .registration-v2-page .player-inline-name {
        font-size: 10px;
    }

    .registration-v2-page .player-inline-meta {
        gap: 5px;
        font-size: 9px;
    }

    .registration-v2-page .team-total-score {
        padding: 4px 6px;
        font-size: 10px;
    }

    .registration-v2-page .team-total-score .total-value {
        font-size: 11px;
    }

    .registration-v2-page .status-action-btn {
        padding: 4px 5px;
        font-size: 10px;
    }

    .registration-v2-page .action-menu-toggle {
        width: 30px;
        height: 30px;
    }
}

@media (min-width: 768px) and (max-width: 1919px) {
    .registration-v2-page .players-inline-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .registration-v2-page .player-inline {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        min-height: 30px;
    }

    .registration-v2-page .player-inline-content {
        min-width: 0;
    }

    .registration-v2-page .player-inline-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .registration-v2-page .player-inline-avatar .avatar-img {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 767px) {
    .registration-v2-page .table-controls {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        margin-bottom: 10px;
    }

    .registration-v2-page .search-box {
        min-width: 0;
        max-width: none;
    }

    .registration-v2-page .sort-box {
        gap: 0;
    }

    .registration-v2-page .sort-box label {
        display: none;
    }

    .registration-v2-page .sort-box select {
        min-width: 92px;
        padding: 9px 26px 9px 10px;
        font-size: 12px;
    }

    .registration-v2-page .registered-table-wrapper {
        overflow: visible;
        border: none;
        border-radius: 0;
    }

    .registration-v2-page .registered-table {
        display: block;
        width: 100%;
        table-layout: auto;
    }

    .registration-v2-page .registered-table thead {
        display: none;
    }

    .registration-v2-page .registered-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .registration-v2-page .registered-table tbody tr {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.18);
        padding: 10px;
    }

    .registration-v2-page .registered-table tbody tr td {
        display: none;
        padding: 0;
        border: none;
    }

    .registration-v2-page .registered-table tbody tr .td-players {
        display: block;
        width: 100%;
        max-width: none;
    }

    /* Mobile card header: number | title + meta | status badge | kebab */
    .registration-v2-page .mobile-card-header {
        display: grid;
        grid-template-columns: 28px 1fr auto auto;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }

    .registration-v2-page .mobile-card-number {
        font-weight: 800;
        font-size: 18px;
        color: var(--text-primary);
        line-height: 1.2;
        padding-top: 2px;
    }

    .registration-v2-page .mobile-card-title-block {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .registration-v2-page .mobile-card-name {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .registration-v2-page .mobile-card-meta-row {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        font-size: 11px;
        color: var(--text-secondary);
    }

    .registration-v2-page .mobile-card-meta-row i {
        font-size: 10px;
        margin-right: 3px;
    }

    .registration-v2-page .mobile-card-status {
        font-size: 11px;
        font-weight: 700;
        padding: 3px 10px;
        border-radius: 6px;
        border: 1px solid;
        white-space: nowrap;
        margin-top: 2px;
    }

    .registration-v2-page .mobile-card-status.status-pending {
        color: #f6c965;
        border-color: rgba(246,201,101,0.4);
        background: rgba(246,201,101,0.08);
    }

    .registration-v2-page .mobile-card-status.status-approved {
        color: #7ee787;
        border-color: rgba(126,231,135,0.4);
        background: rgba(126,231,135,0.08);
    }

    .registration-v2-page .mobile-card-status.status-rejected {
        color: #ff8b8b;
        border-color: rgba(255,139,139,0.4);
        background: rgba(255,139,139,0.08);
    }

    .registration-v2-page .mobile-card-header .action-menu {
        margin-top: 2px;
    }

    .registration-v2-page .mobile-card-header .action-menu-list {
        right: 0;
        left: auto;
    }

    /* Player rows inside mobile card */
    .registration-v2-page .mobile-player-row {
        display: grid;
        grid-template-columns: 22px 36px 1fr;
        align-items: center;
        gap: 6px 8px;
        padding: 6px 0;
        border-top: 1px solid rgba(255,255,255,0.06);
    }

    .registration-v2-page .mobile-player-label {
        font-size: 10px;
        font-weight: 700;
        color: var(--text-secondary);
        text-transform: uppercase;
    }

    .registration-v2-page .mobile-player-avatar .avatar-img {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        object-fit: cover;
    }

    .registration-v2-page .mobile-player-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .registration-v2-page .mobile-player-name {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .registration-v2-page .mobile-player-meta {
        display: flex;
        gap: 10px;
        font-size: 11px;
        color: var(--text-secondary);
    }

    .registration-v2-page .mobile-player-meta i {
        font-size: 10px;
        margin-right: 3px;
    }

    /* Updated date + paid time row */
    .registration-v2-page .mobile-card-dates {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 6px 0 8px;
        border-top: 1px solid rgba(255,255,255,0.06);
        font-size: 11px;
        color: var(--text-secondary);
    }

    /* Action buttons row */
    .registration-v2-page .mobile-card-actions {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0px;
        flex-wrap: wrap;
    }

    .registration-v2-page .mobile-action-btn {
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 5px;
        margin-left: 8px;;
        border-radius: 8px;
        font-size: 10px;
        font-weight: 600;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.04);
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s;
                min-width: 0;
                width: 100%;
          align-items: center;
  justify-content: center;
  text-align: center;
    }

    .registration-v2-page .mobile-action-btn i {
        font-size: 16px;
    }

    .registration-v2-page .mobile-action-btn.btn-approve {
        border-color: rgba(126,231,135,0.35);
        color: #7ee787;
        width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }

    .registration-v2-page .mobile-action-btn.btn-approve:hover {
        background: rgba(126,231,135,0.12);
    }

    .registration-v2-page .mobile-action-btn.btn-reject {
        border-color: rgba(255,139,139,0.35);
        color: #ff8b8b;
                width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }

    .registration-v2-page .mobile-action-btn.btn-reject:hover {
        background: rgba(255,139,139,0.12);
    }

    .registration-v2-page .mobile-action-btn.btn-paid {
        border-color: rgba(14,165,233,0.35);
        color: #38bdf8;
                width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }

    .registration-v2-page .mobile-action-btn.btn-paid:hover {
        background: rgba(14,165,233,0.12);
    }

    .registration-v2-page .mobile-action-btn.btn-edit {
        border-color: rgba(250,204,21,0.35);
        color: #facc15;
                width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }

    .registration-v2-page .mobile-action-btn.btn-edit:hover {
        background: rgba(250,204,21,0.12);
    }

    .registration-v2-page .mobile-action-btn.btn-view {
        border-color: rgba(148,163,184,0.35);
        color: #cbd5e1;
                width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }

    .registration-v2-page .mobile-action-btn.btn-view:hover {
        background: rgba(148,163,184,0.12);
    }

    .registration-v2-page .mobile-action-btn.btn-delete {
        border-color: rgba(239,68,68,0.35);
        color: #ef4444;
                width: auto;
        flex: 1 1 auto;
        white-space: nowrap;
    }

    .registration-v2-page .mobile-action-btn.btn-delete:hover {
        background: rgba(239,68,68,0.12);
    }

    .registration-v2-page .td-actions,
    .registration-v2-page .td-review-status,
    .registration-v2-page .td-fee-status,
    .registration-v2-page .td-date,
    .registration-v2-page .td-team-total,
    .registration-v2-page .td-paid-time,
    .registration-v2-page .td-code {
        display: none !important;
    }

    .registration-v2-page .players-inline-grid {
        display: none !important;
    }

    .registration-v2-page .mobile-card-header,
    .registration-v2-page .mobile-player-row,
    .registration-v2-page .mobile-card-dates,
    .registration-v2-page .mobile-card-actions {
        display: revert;
    }
}
