/* ===== IPL Satta Auction — cricbhai design system ===== */

/* ===== Cricbhai Modal ===== */
.cb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cbFadeIn 0.15s ease;
}
@keyframes cbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cb-modal {
    background: var(--card-white);
    border: 4px solid var(--border-black);
    border-radius: 20px;
    box-shadow: 6px 6px 0px 0px rgba(0,0,0,1);
    padding: 28px 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: cbSlideIn 0.18s ease;
}
@keyframes cbSlideIn {
    from { transform: translateY(-16px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.cb-modal-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    line-height: 1;
}
.cb-modal-title {
    font-family: var(--font-header);
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 0 0 8px;
}
.cb-modal-msg {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #475569;
    margin: 0 0 16px;
    line-height: 1.5;
}
.cb-modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 3px solid var(--border-black);
    border-radius: 12px;
    font-family: var(--font-header);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 4px;
    margin-bottom: 16px;
    box-sizing: border-box;
    outline: none;
}
.cb-modal-input:focus {
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
}
.cb-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.cb-modal-btn {
    flex: 1;
    padding: 12px 16px;
    border: 3px solid var(--border-black);
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 3px 3px 0px 0px rgba(0,0,0,1);
    transition: transform 0.1s, box-shadow 0.1s;
}
.cb-modal-btn:active {
    transform: translate(2px,2px);
    box-shadow: 1px 1px 0px 0px rgba(0,0,0,1);
}
.cb-modal-btn.primary { background: var(--gold); color: var(--text-dark); }
.cb-modal-btn.danger  { background: var(--cricket-red); color: #fff; }
.cb-modal-btn.success { background: var(--turf-green); color: #fff; }
.cb-modal-btn.ghost   { background: var(--card-white); color: var(--text-dark); }

/* Start Auction button */
.start-auction-btn {
    display: inline-block;
    padding: 14px 40px;
    border: 3px solid var(--border-black);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gold) 0%, #F59E0B 100%);
    color: var(--text-dark);
    font-family: var(--font-header);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
    transition: transform 0.1s, box-shadow 0.1s;
    margin-top: 8px;
}
.start-auction-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px 0px rgba(0, 0, 0, 1);
}
.start-auction-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px 0px rgba(0, 0, 0, 1);
}

/* Section headings */
.section-heading {
    font-family: var(--font-header);
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

/* ===== Auction Control Bar: Player + Sell side by side ===== */
.auction-control-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* Current Player Card — left half */
.current-player-card {
    flex: 1;
    background: var(--card-white);
    border: 4px solid var(--border-black);
    border-radius: 16px;
    padding: 20px 20px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
    position: relative;
    overflow: hidden;
    /* dynamic gradient set via JS */
    background: var(--card-gradient, var(--card-white));
}
/* Large IPL team logo watermark */
.player-card-watermark {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.08;
    pointer-events: none;
}
/* Lot number badge */
.auction-lot {
    position: absolute;
    top: 10px;
    left: 12px;
    font-family: var(--font-header);
    font-size: 0.85rem;
    color: #94A3B8;
    opacity: 0.7;
}
/* Set progress bar */
.set-progress {
    margin-bottom: 12px;
    align-self: stretch;
}
.set-progress-label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    margin-bottom: 4px;
    text-align: left;
}
.set-progress-bar {
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.set-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
/* Player badge */
.player-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    border: 2px solid var(--border-black);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    align-self: center;
    position: relative;
    z-index: 1;
}
/* IPL team-colored border — set dynamically via JS */

.player-badge.set-marquee { background: var(--gold); color: var(--text-dark); }
.player-badge.set-a { background: #3B82F6; color: #fff; }
.player-badge.set-b { background: var(--turf-green); color: #fff; }
.player-badge.set-c { background: #94A3B8; color: #fff; }

.player-info {
    position: relative;
    z-index: 1;
}
.player-info h2 {
    font-family: var(--font-header);
    font-size: 1.6rem;
    margin-bottom: 6px;
    color: var(--text-dark);
}
.player-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.player-meta span {
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: #64748B;
    background: rgba(255,255,255,0.85);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}
.base-price {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #64748B;
    position: relative;
    z-index: 1;
}
.base-price strong {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-family: var(--font-header);
}

/* Sell Controls — right half */
.sell-controls {
    flex: 1;
    background: var(--card-white);
    border: 4px solid var(--border-black);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}
.sell-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.sell-row label {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 55px;
}
.sell-row select {
    flex: 1;
    padding: 8px 10px;
    border: 3px solid var(--border-black);
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    background: #fff;
    appearance: auto;
}
.price-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    border: 3px solid var(--border-black);
    border-radius: 10px;
    overflow: hidden;
}
.price-currency, .price-unit {
    font-family: var(--font-header);
    font-size: 1.1rem;
    color: #64748B;
    padding: 0 8px;
}
.price-input-group input {
    flex: 1;
    text-align: center;
    border: none;
    font-family: var(--font-header);
    font-size: 1.2rem;
    padding: 10px 4px;
    background: #fff;
    color: var(--text-dark);
    -moz-appearance: textfield;
}
.price-input-group input:focus {
    outline: none;
}
.price-input-group input::-webkit-outer-spin-button,
.price-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Sell action buttons */
.sell-actions {
    display: flex;
    gap: 8px;
}
.action-btn {
    flex: 1;
    padding: 12px 6px;
    border: 3px solid var(--border-black);
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
}
.action-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px 0px rgba(0, 0, 0, 1);
}
.sold-btn { background: var(--turf-green); color: #fff; }
.unsold-btn { background: var(--cricket-red); color: #fff; }

/* Tablet + Mobile: stack auction control bar */
@media (max-width: 900px) {
    .auction-control-bar {
        flex-direction: column;
    }
    .action-controls {
        width: 100%;
    }
    .auction-notif {
        white-space: normal;
        font-size: 0.8rem;
    }
    .teams-section-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Action Controls — third box */
.action-controls {
    width: 220px;
    flex-shrink: 0;
    background: #FEF9C3;
    border: 4px solid var(--border-black);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.action-controls-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.action-ctrl-btn {
    width: 100%;
    padding: 10px 8px;
    border: 3px solid var(--border-black);
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    background: var(--gold);
    color: var(--text-dark);
    box-shadow: 3px 3px 0px 0px rgba(0,0,0,1);
    transition: transform 0.1s, box-shadow 0.1s;
    text-align: center;
}
.action-ctrl-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px 0px rgba(0,0,0,1);
}
.complete-ctrl-btn { background: #94A3B8; color: #fff; opacity: 0.5; cursor: not-allowed; }
.complete-ctrl-btn:not([disabled]) { background: #16A34A; opacity: 1; cursor: pointer; }
.setc-ctrl-btn { background: #64748B; color: #fff; }

/* ===== Teams section header row ===== */
.teams-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.teams-section-header .section-heading {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* ===== Auction Notification (inline with Teams heading) ===== */
.auction-notif {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 2px solid var(--border-black);
    box-shadow: 3px 3px 0px 0px rgba(0,0,0,1);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    background: #1A1A1A;
}
.notif-sold   { background: #1A1A1A; }
.notif-unsold { background: #1A1A1A; }
.notif-undo   { background: #1A1A1A; }

.notif-label {
    font-family: var(--font-header);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 2px solid var(--border-black);
    flex-shrink: 0;
}
.notif-label.sold   { background: #16A34A; color: #fff; }
.notif-label.unsold { background: #DC2626; color: #fff; }
.notif-label.undo   { background: #F59E0B; color: #1A1A1A; }

.notif-name  { color: #fff; }
.notif-arrow { color: #4ADE80; font-weight: 400; }
.notif-team  { color: #fff; }
.notif-price { color: #4ADE80; font-family: var(--font-header); font-size: 0.9rem; }

/* ===== Set C Search Panel ===== */
.setc-search-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 8px;
    margin-bottom: 10px;
}
#setc-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 3px solid var(--border-black);
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    background: #fff;
    box-sizing: border-box;
}
#setc-search-input:focus { outline: none; border-color: #64748B; }
.setc-player-list {
    flex: 1;
    overflow-y: auto;
    max-height: 160px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    background: #F8FAFC;
}
.setc-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    border-bottom: 1px solid #E2E8F0;
    transition: background 0.1s;
}
.setc-player-item:last-child { border-bottom: none; }
.setc-player-item:not(.taken):hover { background: #EFF6FF; }
.setc-player-item.active { background: #DBEAFE; }
.setc-player-item.taken {
    opacity: 0.5;
    cursor: default;
    text-decoration: line-through;
}
.setc-p-name {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    flex: 1;
}
.setc-p-meta {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #64748B;
}
.setc-p-team {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: #16A34A;
    background: #D1FAE5;
    border-radius: 6px;
    padding: 1px 6px;
}
.setc-empty {
    padding: 12px;
    text-align: center;
    color: #94A3B8;
    font-family: var(--font-body);
    font-size: 0.85rem;
}

/* Keep undo-btn class for any legacy usage */
.undo-btn {
    background: var(--gold);
    color: var(--text-dark);
    border: 2px solid var(--border-black);
    border-radius: 8px;
    padding: 6px 16px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ===== Teams Snapshot Grid (same as T20 WC All Teams layout) ===== */
.teams-snapshot-section { margin-bottom: 24px; }
.teams-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.ts-card {
    background: var(--card-white);
    border: 3px solid var(--border-black);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
}
.ts-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #F1F5F9;
    margin-bottom: 8px;
}
.ts-card-header .ts-name {
    font-family: var(--font-header);
    font-size: 1.1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ts-card-header .ts-owner {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: #94A3B8;
    margin-left: 4px;
}
.ts-card-header .ts-purse {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.2rem;
}
.ts-card-header .ts-purse.low { color: var(--cricket-red); }
.ts-card-header .ts-purse.ok { color: var(--turf-green); }

.ts-card-players {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ts-player {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 4px 0;
}
.ts-player .ts-p-name {
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow: hidden;
    max-width: 75%;
}
.ts-player .ts-p-player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}
.ts-cv-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1;
    margin-right: 4px;
}
.ts-c {
    background: #F59E0B;
    color: #fff;
}
.ts-vc {
    background: #94A3B8;
    color: #fff;
}
.ts-player .ts-p-ipl {
    flex-shrink: 0;
    white-space: nowrap;
}
.ts-player .ts-p-os {
    flex-shrink: 0;
    margin-left: 2px;
    width: 11px;
    height: 11px;
    vertical-align: middle;
}
.ts-player .ts-p-price {
    font-family: var(--font-data);
    color: #334155;
    font-weight: 800;
    font-size: 1.05em;
}
.ts-empty {
    color: #94A3B8;
    font-family: var(--font-header);
    font-size: 0.8rem;
    padding: 4px 0;
}

/* Purse progress bar inside team card */
.ts-purse-bar {
    height: 4px;
    background: #E2E8F0;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.ts-purse-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* ===== Player Queue ===== */
.player-queue { margin-bottom: 24px; }
.queue-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.queue-filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-black);
    border-radius: 20px;
    background: var(--card-white);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
}
.queue-filter-btn.active {
    background: var(--text-dark);
    color: #fff;
}
.queue-export-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px 0;
    background: #1E293B;
    color: #4ADE80;
    border: 2px solid #4ADE80;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.15s;
}
.queue-export-btn:hover { background: #0F172A; }
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.queue-item {
    background: var(--card-white);
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.1s;
}
.queue-item:hover { background: #F8FAFC; }
.queue-item.sold, .queue-item:not(.unsold-q):not(.current) { cursor: default; }
.queue-item.unsold-q { cursor: pointer; }
.queue-item.current {
    border: 3px solid var(--text-dark);
    background: #FEF9C3;
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
}
.queue-item.sold { opacity: 0.35; text-decoration: line-through; }
.queue-item.unsold-q { opacity: 0.45; background: #FEE2E2; }
.queue-item .q-name { font-weight: 600; }
.queue-item .q-ipl { color: #64748B; font-weight: 500; font-size: 0.85em; }
.queue-item .q-os { width: 13px; height: 13px; vertical-align: middle; }
.queue-item .q-set {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid var(--border-black);
}

/* Set badge colors */
.set-marquee { background: var(--gold); color: var(--text-dark); }
.set-a { background: #3B82F6; color: #fff; }
.set-b { background: var(--turf-green); color: #fff; }
.set-c { background: #94A3B8; color: #fff; }

/* Empty state */
.empty-state {
    text-align: center;
    color: #94A3B8;
    font-family: var(--font-body);
    font-style: italic;
    padding: 30px 16px;
}

/* Pause bar */
.pause-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FEE2E2;
    border: 3px solid var(--border-black);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-family: var(--font-header);
    font-size: 1rem;
    color: var(--cricket-red);
    box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
}


.download-teams-btn {
    background: var(--text-dark);
    color: #fff;
    border: 3px solid var(--border-black);
    border-radius: 10px;
    padding: 10px 24px;
    font-family: var(--font-header);
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
    transition: transform 0.1s;
}
.download-teams-btn:hover { transform: translateY(-1px); }
.download-teams-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .teams-snapshot-grid { grid-template-columns: 1fr; }
    .download-teams-btn { display: none; }
}
@media (max-width: 767px) {
    .download-teams-btn { display: none; }
}
@media (min-width: 481px) and (max-width: 767px) {
    .teams-snapshot-grid { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
    .teams-snapshot-grid { grid-template-columns: repeat(3, 1fr); }
}
