/* Blackjack Strategy Trainer Styles */

/* Table Area */
.bj-table {
    background: linear-gradient(145deg, #0d5c38, #0a4a2d);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    position: relative;
    min-height: 320px;
    box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.4);
}

.bj-table::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    pointer-events: none;
}

/* Hand Labels */
.bj-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

/* Card Container */
.bj-hand {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 100px;
}

/* Playing Cards */
.playing-card {
    width: 60px;
    height: 84px;
    background: linear-gradient(145deg, #fff, #f5f5f5);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Georgia', serif;
    position: relative;
    transition: transform 0.15s ease;
}

.playing-card:hover {
    transform: translateY(-4px);
}

.playing-card .rank {
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
}

.playing-card .suit {
    font-size: 1.5rem;
    line-height: 1;
    margin-top: 2px;
}

.playing-card.red {
    color: #d32f2f;
}

.playing-card.black {
    color: #1a1a1a;
}

/* Face-down card */
.playing-card.face-down {
    background: linear-gradient(135deg, #1a3a7c 25%, #234ea0 25%, #234ea0 50%, #1a3a7c 50%, #1a3a7c 75%, #234ea0 75%);
    background-size: 8px 8px;
}

.playing-card.face-down::after {
    content: '?';
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Card deal animation */
@keyframes dealCard {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.6) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

.playing-card.dealing {
    animation: dealCard 0.35s ease-out forwards;
}

/* Hand Total Display */
.bj-total {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    display: inline-block;
}

.bj-total.soft {
    background: rgba(92, 210, 185, 0.3);
}

.bj-total.pair {
    background: rgba(147, 112, 219, 0.3);
}

/* Action Buttons */
.bj-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-action {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-hit {
    background: linear-gradient(145deg, #22c55e, #16a34a);
    color: #fff;
}

.btn-hit:hover:not(:disabled) {
    background: linear-gradient(145deg, #16a34a, #15803d);
    transform: translateY(-2px);
}

.btn-stand {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #fff;
}

.btn-stand:hover:not(:disabled) {
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
}

.btn-double {
    background: linear-gradient(145deg, #eab308, #ca8a04);
    color: #1a1a1a;
}

.btn-double:hover:not(:disabled) {
    background: linear-gradient(145deg, #ca8a04, #a16207);
    transform: translateY(-2px);
}

.btn-split {
    background: linear-gradient(145deg, #a855f7, #9333ea);
    color: #fff;
}

.btn-split:hover:not(:disabled) {
    background: linear-gradient(145deg, #9333ea, #7e22ce);
    transform: translateY(-2px);
}

/* Feedback Messages */
.bj-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.bj-feedback.correct {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #86efac;
}

.bj-feedback.wrong {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.bj-feedback .action-label {
    font-weight: 600;
    text-transform: uppercase;
}

/* Feedback animations */
@keyframes correctPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.bj-feedback.correct {
    animation: correctPulse 0.5s ease-out;
}

.bj-feedback.wrong {
    animation: wrongShake 0.4s ease-out;
}

/* Stats Panel */
.bj-stats {
    background: var(--panel);
    border-radius: 12px;
    padding: 1rem;
}

.bj-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bj-stat-item:last-child {
    border-bottom: none;
}

.bj-stat-label {
    color: var(--muted);
    font-size: 0.875rem;
}

.bj-stat-value {
    font-weight: 600;
    color: var(--text);
}

.bj-stat-value.positive {
    color: #22c55e;
}

.bj-stat-value.negative {
    color: #ef4444;
}

/* Streak Badge */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: #1a1a1a;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Strategy Chart */
.strategy-chart {
    overflow-x: auto;
    margin-top: 1rem;
}

.strategy-chart table {
    border-collapse: collapse;
    font-size: 0.7rem;
    width: 100%;
    min-width: 400px;
}

.strategy-chart th,
.strategy-chart td {
    padding: 0.35rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.strategy-chart th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.strategy-chart .cell-hit {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.strategy-chart .cell-stand {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.strategy-chart .cell-double {
    background: rgba(234, 179, 8, 0.3);
    color: #fde047;
}

.strategy-chart .cell-split {
    background: rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
}

/* Training Mode Selector */
.mode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mode-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn:hover {
    background: rgba(92, 210, 185, 0.1);
    border-color: var(--brand);
}

.mode-btn.active {
    background: var(--brand);
    color: #1a1a1a;
    border-color: var(--brand);
}

/* Responsive */
@media (max-width: 768px) {
    .bj-table {
        padding: 1.5rem 1rem;
    }

    .playing-card {
        width: 50px;
        height: 70px;
    }

    .playing-card .rank {
        font-size: 1rem;
    }

    .playing-card .suit {
        font-size: 1.25rem;
    }

    .bj-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-action {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Next Hand Button */
.btn-next {
    background: linear-gradient(145deg, var(--brand), #4ab8a2);
    color: #1a1a1a;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 1rem;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 210, 185, 0.3);
}

/* Loading state */
.bj-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--muted);
}

.bj-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--brand);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Explanation text */
.bj-explanation {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.5rem;
}
