/* ========================================
   Pages - Player, Admin, OBS specific styles
   ======================================== */

/* ===================================
   Player Pages
   =================================== */

/* Player Page Width Constraint (PC only) */
@media (min-width: 992px) {
    body.player-page #mainContainer.container-fluid {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Menu Cards */
.menu-card {
    position: relative;
    height: 100%;
    transition: all 0.3s ease;
}

/* ===== Cart item UI improvements ===== */
.cart-item {
    padding: 0.75rem 0.75rem;
    font-size: 1rem; /* slightly larger overall */
}
.cart-item .product-name {
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 600;
}
.cart-item .product-name strong {
    font-weight: 600; /* product name weight adjusted to 600 */
}
.btn-like-nikoru {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.45rem;
    border-radius: 10px;
}
.btn-like-nikoru .nikoru-icon {
    width: 22px;
    height: 22px;
}
.btn-like-nikoru .likes-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}
.added-by-list .badge {
    padding: 0.38rem 0.6rem;
    font-size: 0.9rem;
}
.qty-badge {
    display: none; /* removed green quantity badge - kept class for compatibility */
}
.ppl-count {
    font-size: 0.85rem;
}

/* Ensure removed controls area doesn't collapse layout on very small screens */
.cart-item .d-flex { align-items: center; }


.menu-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.menu-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-card .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.menu-card .card-info {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.menu-card .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

/* Size list for menu cards */
.size-list {
    margin-top: 0.25rem;
}

.size-list .small {
    color: #212529;
}

.size-list div {
    color: #212529;
}

/* Category Tabs */
.category-tabs {
    margin-bottom: 2rem;
}

.category-tabs .nav-link {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--theme-soft);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 2px solid var(--theme-base);
    transition: none;
}

.category-tabs .nav-link:hover {
    background: var(--theme-base);
    color: var(--text-dark);
    border-color: var(--theme-muted);
    transform: none;
}

.category-tabs .nav-link.active {
    background: var(--theme-base);
    color: var(--text-dark);
    border-color: var(--theme-muted);
    box-shadow: 0 4px 15px rgba(93, 156, 190, 0.25);
}

.category-tabs .nav-link i {
    margin-right: 0.5rem;
}

.category-header {
    background: var(--theme-soft);
    color: var(--text-dark);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(93, 156, 190, 0.18);
}

.category-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Quantity Controls */
.qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--theme-muted);
    background: var(--card-bg);
    color: var(--theme-dark);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.2rem;
}

.qty-btn:hover {
    background: var(--theme-soft);
    color: var(--text-dark);
    transform: scale(1.06);
    border-color: var(--theme-base);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-display {
    min-width: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
}

.qty-input {
    width: 68px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    border: 2px solid var(--theme-muted);
    border-radius: 12px;
    padding: 0.2rem 0.4rem;
    background: var(--theme-lighter);
    height: 44px;
}

.qty-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(93, 156, 190, 0.15);
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    font-weight: 600;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Team Cart Styles */
.team-cart-item {
    padding: 0.8rem 1rem;
}

.team-cart-item .btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.12);
}

.team-cart-item .team-item-qty {
    min-width: 3.2em;
    font-size: 1.15rem;
    padding: 0.15rem 0.35rem;
}

.team-cart-item .btn-remove {
    padding: 0.45rem 0.6rem;
}

.team-cart-qty-control {
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.team-cart-delete-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.team-cart-contrib-control {
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 0.75rem;
    background: rgba(255,255,255,0.75);
    margin-bottom: 0.75rem;
}

.team-cart-contrib-control:last-child {
    margin-bottom: 0;
}

.team-cart-contrib-control .contrib-label {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.team-cart-contrib-control .team-cart-qty-control .team-cart-delete-btn {
    width: 38px;
    height: 38px;
}

#teamCartTable td {
    vertical-align: top;
}

/* Team Header */
.team-header-badges .badge {
    margin-left: 0.4rem;
}

/* Team Preview & Radio */
.team-preview {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: var(--theme-lighter);
    border-radius: 8px;
    border: 1px solid var(--theme-light);
}

.team-preview .team-badge {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--text-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.team-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.team-radio-item {
    flex: 1;
    min-width: 120px;
}

.team-radio-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 2px solid var(--theme-light);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.team-radio-btn:hover {
    border-color: var(--theme-base);
    background: var(--theme-lighter);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.team-radio-btn.active {
    border-color: var(--theme-base);
    background: var(--theme-base);
    color: white;
    box-shadow: var(--card-shadow);
}

.team-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.team-radio-btn.active .team-color-indicator {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Receipt Paper */
.receipt-paper {
    width: 384px;
    margin: 0 auto;
    background: var(--card-bg);
    color: var(--text-dark);
    padding: 16px 12px;
    box-shadow: 0 0 0 1px var(--card-border);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.4;
}

.receipt-header {
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.receipt-sub {
    text-align: center;
    margin-bottom: 8px;
}

.receipt-meta {
    margin-bottom: 8px;
}

.receipt-sep {
    border-top: 1px dashed #999;
    margin: 8px 0;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-table td {
    padding: 4px 0;
    vertical-align: top;
}

.receipt-table td.name {
    width: 55%;
    word-break: break-word;
}

.receipt-table td.qty {
    width: 10%;
    text-align: right;
    white-space: nowrap;
}

.receipt-table td.price {
    width: 15%;
    text-align: right;
    white-space: nowrap;
}

.receipt-table td.sum {
    width: 20%;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

.receipt-total {
    text-align: right;
    font-weight: 700;
    margin-top: 8px;
}

.receipt-footer {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: #64748b;
}

/* ===================================
   Admin Pages
   =================================== */

/* Admin Order Cards */
.admin-order-card {
    border-radius: 0.6rem;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
    background: var(--card-bg);
}

.admin-order-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.admin-order-card.order-status-passed {
    border-left: 4px solid var(--bs-success);
}

.admin-order-card.order-status-failed {
    border-left: 4px solid var(--bs-danger);
}

.admin-order-card.order-status-live {
    border-left: 4px solid var(--bs-warning);
    background: linear-gradient(180deg, rgba(var(--theme-warning-rgb),0.03), rgba(255,255,255,0));
}

.admin-order-card.order-status-live .order-icon {
    color: var(--bs-warning);
}

.admin-order-card.order-status-live .order-card-header {
    background: rgba(var(--theme-warning-rgb),0.04);
}

.admin-order-card.order-status-live .order-card-footer {
    border-top-color: rgba(var(--theme-warning-rgb),0.08);
}

.admin-order-card .order-card-header {
    background: var(--bs-light);
    padding: 0.75rem 1rem;
}

.admin-order-card .order-icon {
    color: var(--theme-dark);
    background: rgba(var(--theme-base-rgb), 0.08);
}

.admin-order-card.order-status-passed .order-icon {
    color: var(--bs-success);
}

.admin-order-card.order-status-failed .order-icon {
    color: var(--bs-danger);
}

.admin-order-card .order-card-header h6 {
    font-size: 1.05rem;
    margin: 0;
}

.admin-order-card .order-team-id {
    font-size: 0.85rem;
    display: block;
}

.admin-order-card .cart-detail .d-flex {
    padding: 0.18rem 0;
    gap: 0.5rem;
    align-items: center;
}

.admin-order-card .cart-detail .flex-grow-1 span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-order-card .cart-detail .text-muted.fallback-latin {
    margin-left: 0.5rem;
}

.admin-order-card .order-card-footer {
    gap: 0.5rem;
}

.admin-order-card .order-card-footer .d-flex {
    flex-direction: row;
    align-items: center;
}

.admin-order-card .order-card-footer .btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.admin-order-card .order-card-total .fs-4 {
    font-size: 1.15rem;
}

.admin-order-card .order-card-total .fs-4,
.admin-order-card .cart-detail td.text-end,
.admin-order-card .cart-detail .text-end,
.team-cart-inline .text-end {
    color: var(--theme-info);
}

.order-card-header .rounded-circle {
    display: inline-block;
    font-size: 1.05rem;
    background: var(--card-bg);
    border: 1px solid rgba(93, 156, 190, 0.15);
}

.order-card-contributors .badge.team-badge {
    background: var(--card-bg);
    color: var(--bs-dark);
    border: 1px solid rgba(93, 156, 190, 0.12);
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.order-card-footer {
    gap: 1rem;
}

.order-card-total {
    min-width: 140px;
}

.order-card-total .fs-4 {
    color: var(--theme-dark);
    letter-spacing: 0.5px;
}

.cart-detail,
.order-detail {
    background: rgba(255,255,255,0.6);
}

.cart-detail {
    background: rgba(255,255,255,0.85);
    padding: 0.5rem;
    border-radius: 8px;
}

.order-detail {
    border-top: 1px dashed rgba(0,0,0,0.06);
    padding-top: 0.75rem;
}

.order-detail .table {
    margin-bottom: 0.5rem;
}

.order-detail .text-end.small {
    font-weight: 700;
}

.order-detail .badge {
    font-size: 0.75rem;
}

/* Orders Grid Layout */
.orders-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 1rem !important;
    align-items: start;
    width: 100% !important;
    box-sizing: border-box !important;
}

.orders-grid > .order-col {
    display: flex !important;
    width: 100% !important;
}

.orders-grid > .order-col > .admin-order-card {
    width: 100%;
}

.orders-grid.single-team {
    grid-template-columns: 1fr !important;
}

@media (min-width: 960px) {
    .orders-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

#ordersRoot > .orders-grid {
    margin-top: 0.5rem;
}

/* Orders Container */
#ordersContainer .card {
    transition: none !important;
}

#ordersContainer .card-body {
    transition: none !important;
}

#ordersCardHeader {
    flex-wrap: wrap;
    gap: 0.75rem;
}

#ordersCardHeader,
#ordersCardHeader * {
    color: var(--text-dark) !important;
}

#ordersCardHeader .text-white-50 {
    color: rgba(0,0,0,0.65) !important;
}

#ordersCardHeader .btn-outline-light {
    color: var(--text-dark) !important;
    border-color: rgba(0,0,0,0.06) !important;
    background-color: rgba(255,255,255,0.9) !important;
}

/* Admin Orders Card */
#ordersCard.admin-orders-card {
    border-radius: 16px;
    padding: 0;
    overflow: visible;
}

#ordersCardHeader {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: sticky;
    top: 70px;
    z-index: 1030;
    backdrop-filter: none;
    background-color: rgba(230, 243, 249, 0.98);
}

#ordersCardHeader h5 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

#ordersCard .card-header {
    overflow: visible;
}

#teamsListHeader {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.teams-chip {
    background: var(--card-bg);
    color: var(--text-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(93, 156, 190, 0.12);
    border-left: 4px solid var(--theme-muted);
}

.teams-header-full {
    width: 100%;
}

.teams-header-full .card {
    border-radius: 12px;
    box-shadow: none;
    background: rgba(255,255,255,0.95);
}

.teams-header-full .card .card-header {
    padding: 0.5rem 0.75rem;
}

.teams-header-full .card .card-body {
    padding: 0.5rem 0.75rem;
    font-size: 0.92rem;
}

.orders-list {
    display: block;
}

/* Responsive Admin Styles */
@media (max-width: 767px) {
    .admin-order-card .order-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-order-card .order-card-footer .d-flex {
        justify-content: space-between;
    }

    #ordersCardHeader {
        position: relative;
        top: 0;
    }

    .teams-chip {
        font-size: 0.78rem;
        padding: 0.18rem 0.45rem;
    }

    .order-card-header .rounded-circle {
        width: 40px;
        height: 40px;
        line-height: 40px;
    }
}

@media (max-width: 576px) {
    #ordersCardHeader .btn-group {
        display: none;
    }

    #teamsListHeader {
        gap: 0.25rem;
    }

    .teams-chip {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .order-card-total {
        min-width: 110px;
    }

    .team-cart-qty-control {
        justify-content: space-between;
        gap: 0.5rem;
    }
}

/* ===================================
   Responsive Player Styles
   =================================== */

@media (max-width: 768px) {
    .team-cart-item .d-flex.align-items-center.gap-2 {
        gap: 0.75rem;
    }

    .team-cart-item .btn {
        padding: 0.6rem 0.9rem;
        font-size: 1.15rem;
        min-width: 40px;
        min-height: 40px;
    }

    .d-flex.flex-column.flex-md-row.align-items-center.justify-content-center.gap-3.mb-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }

    #teamColorBadge {
        min-width: 2.8em;
        height: 2.8em;
        font-size: 1.4em;
    }

    #teamName {
        font-size: 1.35rem;
        text-align: center;
    }

    .d-flex.justify-content-between.align-items-center.mb-4.p-3.bg-light.rounded-3 {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .d-flex.justify-content-between.align-items-center.mb-4.p-3.bg-light.rounded-3 .btn-primary {
        width: 100%;
    }

    .card-header.py-3 {
        padding: 0.8rem 1rem;
    }

    .team-cart-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .team-cart-item .d-flex.align-items-center.gap-2.mt-3.mt-md-0 {
        justify-content: flex-end;
    }

    .team-cart-item .d-flex.align-items-center.gap-2 {
        width: 100%;
        justify-content: space-between;
    }

    .team-item-qty {
        font-size: 1.25rem;
        min-width: 3.6em;
        text-align: center;
    }

    @media (max-width: 420px) {
        .team-cart-item .btn {
            flex: 1 1 auto;
            margin: 0 0.25rem;
        }

        .team-cart-item .d-flex.align-items-center.gap-2 {
            gap: 0.5rem;
        }
    }

    .text-center.my-5 {
        margin-top: 1rem !important;
        margin-bottom: 4rem !important;
    }

    #teamCartConfirmBtn {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .receipt-paper {
        width: 100%;
        max-width: 280px;
        padding: 12px 8px;
        font-size: 11px;
    }

    .category-tabs .nav-link {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .menu-card .card-title {
        font-size: 1rem;
        min-height: auto;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .qty-display {
        font-size: 1.2rem;
        min-width: 40px;
    }

    .qty-input {
        width: 50px;
        font-size: 1.1rem;
        height: 36px;
    }

    .team-cart-item .btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem 0.6rem;
    }

    .team-item-qty {
        font-size: 1rem;
        min-width: 2.5em;
    }

    .admin-order-card .card-body {
        padding: 0.75rem;
    }

    .order-card-header .rounded-circle {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 0.9rem;
    }

    .order-card-total {
        min-width: 90px;
    }

    .order-card-total .fs-4 {
        font-size: 1rem !important;
    }
}

@media (max-width: 320px) {
    body {
        font-size: 13px;
        overflow-x: hidden;
    }

    .menu-card {
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .btn-group .btn {
        padding: 0.2rem 0.35rem;
        font-size: 0.7rem;
        min-width: 28px;
    }

    .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 1rem;
    }

    h3 {
        font-size: 0.9rem;
    }

    h6 {
        font-size: 0.8rem;
    }
}

@media (max-width: 300px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-group .btn {
        width: 100%;
        border-radius: 4px !important;
    }
}
