/* Enhanced Team Border Checkers - Larger Pieces */

/* Checkers Board Styles */
.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 700px;  /* Increased from 600px */
    height: 700px; /* Increased from 600px */
    border: 3px solid #8B4513;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.square.light {
    background-color: #F5DEB3;
}

.square.dark {
    background-color: #8B4513;
}

.square.highlighted {
    background-color: #FFD700 !important;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.8);
}

.square.possible-move {
    background-color: #90EE90 !important;
    box-shadow: inset 0 0 10px rgba(144, 238, 144, 0.8);
}

.square.selected {
    background-color: #FF6347 !important;
    box-shadow: inset 0 0 10px rgba(255, 99, 71, 0.8);
}

/* ENHANCED PIECES - Team colored base with color dots */
.piece {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* No border needed - entire piece is team colored */
    border: none;
}

.piece:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.piece.dragging {
    transform: scale(1.2);
    z-index: 20;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

/* Team 1 - White Base */
.piece.team-white {
    background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 50%, #EEEEEE 100%);
    box-shadow: 0 0 0 2px #333, 0 4px 8px rgba(0,0,0,0.3);
}

/* Team 2 - Black Base */
.piece.team-black {
    background: linear-gradient(135deg, #2C2C2C 0%, #1C1C1C 50%, #0C0C0C 100%);
    box-shadow: 0 0 0 2px #FFF, 0 4px 8px rgba(0,0,0,0.3);
}

/* Remove the old ::before pseudo-element */
.piece::before {
    display: none;
}

/* SINGLE COLOR PIECES - Large center dot */
.piece.color-blue::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 50%, #2E6B9E 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-red::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 50%, #A93226 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-green::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27AE60 0%, #229954 50%, #1E8449 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-yellow::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F1C40F 0%, #D4AC0D 50%, #B7950B 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* DUAL COLOR PIECES - Two dots along center line */
.piece.color-blue-red::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-blue-red::before {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    top: 50%;
    right: 30%;
    transform: translate(50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-red-green::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-red-green::before {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    top: 50%;
    right: 30%;
    transform: translate(50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-green-yellow::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-green-yellow::before {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F1C40F 0%, #D4AC0D 100%);
    top: 50%;
    right: 30%;
    transform: translate(50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-blue-yellow::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-blue-yellow::before {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F1C40F 0%, #D4AC0D 100%);
    top: 50%;
    right: 30%;
    transform: translate(50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-blue-green::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-blue-green::before {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    top: 50%;
    right: 30%;
    transform: translate(50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-red-yellow::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.piece.color-red-yellow::before {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F1C40F 0%, #D4AC0D 100%);
    top: 50%;
    right: 30%;
    transform: translate(50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* QUAD-COLOR PIECES - Four dots in quadrants */
/* We'll use multiple box-shadows on the ::after element to create 4 dots */
.piece.color-rainbow::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    /* Blue dot - top left */
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    top: 40%;
    left: 40%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 
        /* Red dot - top right */
        18px 0 0 0 #E74C3C,
        /* Green dot - bottom left */
        0 18px 0 0 #27AE60,
        /* Yellow dot - bottom right */
        18px 18px 0 0 #F1C40F,
        /* Add depth shadows */
        0 2px 4px rgba(0,0,0,0.3),
        18px 2px 4px rgba(0,0,0,0.3),
        0 20px 4px rgba(0,0,0,0.3),
        18px 20px 4px rgba(0,0,0,0.3);
}

/* KING PIECES - Keep existing king styles but ensure they work with new base */
.piece.king {
    /* Kings keep their solid team color - no changes needed */
}

/* White team king - solid white */
.piece.king.team-white {
    background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 50%, #EEEEEE 100%);
    box-shadow: 
        0 0 0 2px #333333,
        0 4px 8px rgba(0,0,0,0.4) !important;
}

/* Black team king - solid black */
.piece.king.team-black {
    background: linear-gradient(135deg, #2C2C2C 0%, #1C1C1C 50%, #0C0C0C 100%);
    box-shadow: 
        0 0 0 2px #FFFFFF,
        0 4px 8px rgba(0,0,0,0.4) !important;
}

/* Hide color dots on kings */
.piece.king::before,
.piece.king::after {
    display: none !important;
}

/* King crown symbol - enhanced visibility */
.piece.king::after {
    content: '♛' !important;
    display: block !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    z-index: 2;
}

/* White king crown - dark gold for contrast */
.piece.king.team-white::after {
    color: #B8860B;
    text-shadow: 
        0 0 3px rgba(0,0,0,0.8),
        1px 1px 2px rgba(0,0,0,0.6);
}

/* Black king crown - bright gold for contrast */
.piece.king.team-black::after {
    color: #FFD700;
    text-shadow: 
        0 0 3px rgba(255,255,255,0.8),
        1px 1px 2px rgba(255,255,255,0.4);
}

/* King hover effects */
.piece.king:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 0 3px #FFD700,
        0 6px 12px rgba(0,0,0,0.5) !important;
}

/* Legend pieces - smaller versions */
.legend-item .piece {
    width: 30px;
    height: 30px;
}

/* Scale down legend dots proportionally */
.legend-item .piece.color-blue::after,
.legend-item .piece.color-red::after,
.legend-item .piece.color-green::after,
.legend-item .piece.color-yellow::after {
    width: 16px;
    height: 16px;
}

.legend-item .piece[class*="color-"]:not(.color-rainbow)::after,
.legend-item .piece[class*="color-"]:not(.color-rainbow)::before {
    width: 12px;
    height: 12px;
}

.legend-item .piece.color-rainbow::after {
    width: 8px;
    height: 8px;
    box-shadow: 
        10px 0 0 0 #E74C3C,
        0 10px 0 0 #27AE60,
        10px 10px 0 0 #F1C40F;
}

.legend-item .piece.king {
    border: none !important;
}

.legend-item .piece.king::after {
    font-size: 16px !important;
}

/* Piece Legend */
.piece-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

/* MOBILE RESPONSIVE STYLES */
@media (max-width: 768px) {
    .piece {
        width: 45px;
        height: 45px;
    }
    
    /* Single color dots - smaller */
    .piece.color-blue::after,
    .piece.color-red::after,
    .piece.color-green::after,
    .piece.color-yellow::after {
        width: 20px;
        height: 20px;
    }
    
    /* Dual color dots - smaller */
    .piece[class*="color-"]:not(.color-rainbow):not(.king)::after,
    .piece[class*="color-"]:not(.color-rainbow):not(.king)::before {
        width: 14px;
        height: 14px;
    }
    
    /* Adjust dual color positioning for smaller pieces */
    .piece.color-blue-red::after,
    .piece.color-red-green::after,
    .piece.color-green-yellow::after,
    .piece.color-blue-yellow::after,
    .piece.color-blue-green::after,
    .piece.color-red-yellow::after {
        left: 25%;
    }
    
    .piece.color-blue-red::before,
    .piece.color-red-green::before,
    .piece.color-green-yellow::before,
    .piece.color-blue-yellow::before,
    .piece.color-blue-green::before,
    .piece.color-red-yellow::before {
        right: 25%;
    }
    
    /* Rainbow pieces - smaller dots */
    .piece.color-rainbow::after {
        width: 10px;
        height: 10px;
        top: 35%;
        left: 35%;
        box-shadow: 
            12px 0 0 0 #E74C3C,
            0 12px 0 0 #27AE60,
            12px 12px 0 0 #F1C40F,
            0 2px 3px rgba(0,0,0,0.3),
            12px 2px 3px rgba(0,0,0,0.3),
            0 14px 3px rgba(0,0,0,0.3),
            12px 14px 3px rgba(0,0,0,0.3);
    }
    
    /* King crown - smaller */
    .piece.king::after {
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .piece {
        width: 35px;
        height: 35px;
    }
    
    /* Single color dots - even smaller */
    .piece.color-blue::after,
    .piece.color-red::after,
    .piece.color-green::after,
    .piece.color-yellow::after {
        width: 16px;
        height: 16px;
    }
    
    /* Dual color dots - even smaller */
    .piece[class*="color-"]:not(.color-rainbow):not(.king)::after,
    .piece[class*="color-"]:not(.color-rainbow):not(.king)::before {
        width: 11px;
        height: 11px;
    }
    
    /* Rainbow pieces - tiny dots */
    .piece.color-rainbow::after {
        width: 8px;
        height: 8px;
        top: 33%;
        left: 33%;
        box-shadow: 
            10px 0 0 0 #E74C3C,
            0 10px 0 0 #27AE60,
            10px 10px 0 0 #F1C40F,
            0 2px 2px rgba(0,0,0,0.3),
            10px 2px 2px rgba(0,0,0,0.3),
            0 12px 2px rgba(0,0,0,0.3),
            10px 12px 2px rgba(0,0,0,0.3);
    }
    
    /* King crown - smallest */
    .piece.king::after {
        font-size: 16px !important;
    }
}

/* Piece Legend */
.piece-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

/* MOBILE LAYOUT REORGANIZATION */

/* Desktop - keep existing Bootstrap layout */
@media (min-width: 769px) {
    /* Keep your existing desktop layout unchanged */
}

/* Mobile Layout Changes */
@media (max-width: 768px) {
    /* Hide Bootstrap columns and reorganize */
    .row {
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        gap: 0 !important;
    }
    
    .col-md-2,
    .col-md-8 {
        max-width: 100% !important;
        flex: none !important;
        padding: 0 10px !important;
        margin-bottom: 15px;
    }
    
    /* REORDER SECTIONS */
    /* Turn indicator will be inserted by JavaScript with order: -1 */
    
    /* Game board (col-md-8) - move to top (right after turn indicator) */
    .col-md-8 {
        order: 0;
        margin-top: 0 !important;
    }
    
    /* Left sidebar info (first col-md-2) - move below board */
    .col-md-2:first-child {
        order: 1;
    }
    
    /* Right sidebar (second col-md-2) - move to bottom */
    .col-md-2:last-child {
        order: 2;
    }
    
    /* COLLAPSIBLE CARD SYSTEM */
    .card {
        margin-bottom: 10px !important;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .card-header {
        cursor: pointer;
        background: #f8f9fa !important;
        border-bottom: 1px solid #dee2e6;
        padding: 10px 15px !important;
        position: relative;
        transition: all 0.2s ease;
    }
    
    .card-header:hover {
        background: #e9ecef !important;
    }
    
    /* Add toggle indicators */
    .card-header::after {
        content: '−';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        font-weight: bold;
        transition: transform 0.2s ease;
    }
    
    .card.collapsed .card-header::after {
        content: '+';
        transform: translateY(-50%) rotate(0deg);
    }
    
    /* Card body collapsing */
    .card-body {
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .card.collapsed .card-body {
        max-height: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        opacity: 0;
    }
    
    /* GAME BOARD SECTION - Always visible on mobile */
    .col-md-8 .card {
        margin-bottom: 15px !important;
    }
    
    .col-md-8 .card-header {
        background: linear-gradient(135deg, #007bff, #0056b3) !important;
        color: white !important;
        cursor: pointer;
    }
    
    .col-md-8 .card-header::after {
        color: white;
    }
    
    .col-md-8 .card-header:hover {
        background: linear-gradient(135deg, #0056b3, #004085) !important;
    }
    
    /* SIDEBAR SECTIONS - Initially collapsed */
    .col-md-2 .card {
        border: 1px solid #dee2e6;
    }
    
    /* Game info card - special handling for turn indicator */
    .col-md-2:first-child .card:first-child {
        /* This will be handled by JavaScript to show only turn indicator */
    }
    
    /* Collapse all other cards by default */
    .col-md-2 .card:not(:first-child),
    .col-md-2:last-child .card {
        /* These will be collapsed by JavaScript */
    }
    
    /* TURN INDICATOR - Always visible on mobile */
    .turn-indicator-section {
        background: #e3f2fd;
        border: 1px solid #90caf9;
        border-radius: 8px;
        padding: 8px 15px;
        margin-bottom: 8px;
        text-align: center;
        order: -1; /* Force to top */
        width: 100%;
    }
    
    .mobile-turn-display {
        font-size: 16px;
        font-weight: bold;
        color: #1976d2;
        margin-bottom: 8px;
    }
    
    .mobile-turn-display.white-team {
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border: 2px solid #495057;
        color: #212529;
        padding: 8px 12px;
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .mobile-turn-display.black-team {
        background: linear-gradient(135deg, #343a40, #212529);
        border: 2px solid #f8f9fa;
        color: #ffffff;
        padding: 8px 12px;
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    
    .mobile-turn-display .badge {
        font-size: 14px;
        padding: 4px 8px;
        margin-left: 6px;
    }
    
    /* Quick actions below turn indicator */
    .mobile-quick-actions {
        display: flex;
        gap: 8px;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .mobile-quick-actions .btn {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 4px;
    }
    
    /* COMPACT STYLING FOR MOBILE */
    .card-body {
        padding: 12px !important;
        font-size: 14px;
    }
    
    .card-body p {
        margin-bottom: 8px !important;
    }
    
    .card-body .btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* Legend items more compact */
    .legend-item {
        margin-bottom: 6px !important;
        font-size: 13px;
    }
    
    .legend-item .piece {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Move history compact */
    .move-item {
        padding: 4px 0 !important;
        font-size: 12px !important;
    }
    
    /* Color stats compact */
    .card-body small div {
        line-height: 1.4;
        margin-bottom: 3px;
    }
    
    /* Alert messages more compact */
    .alert {
        padding: 8px 12px !important;
        margin-bottom: 10px !important;
        font-size: 13px !important;
    }
    
    /* Turn indicator styling */
    .turn-indicator .badge {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    /* Game board responsive */
    #checkers-board {
        margin: 0 auto;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* WebSocket/AI status */
    .col-md-8 .card:last-child {
        margin-top: 10px !important;
    }
    
    .col-md-8 .card:last-child .card-body {
        padding: 8px 12px !important;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .col-md-2,
    .col-md-8 {
        padding: 0 8px !important;
    }
    
    .card-header {
        padding: 8px 12px !important;
        font-size: 14px;
    }
    
    .card-body {
        padding: 10px !important;
        font-size: 13px;
    }
    
    .card-header h5,
    .card-header h6 {
        font-size: 14px !important;
        margin: 0 !important;
    }
    
    /* Make buttons even more compact */
    .btn-sm {
        font-size: 12px !important;
        padding: 5px 10px !important;
    }
    
    /* Very compact legend */
    .legend-item .piece {
        width: 20px !important;
        height: 20px !important;
    }
    
    .legend-item {
        font-size: 12px !important;
    }
}

/* Move History */
.move-history {
    max-height: 400px;
    overflow-y: auto;
    font-size: 12px;
}

.move-item {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.move-item:nth-child(odd) {
    background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkers-board {
        width: 500px;
        height: 500px;
    }
    
    .piece {
        width: 50px;
        height: 50px;
        border-width: 4px;
    }
    
    .piece::before {
        width: 35px;
        height: 35px;
    }
    
    .piece.king::after {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .checkers-board {
        width: 400px;
        height: 400px;
    }
    
    .piece {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .piece::before {
        width: 28px;
        height: 28px;
    }
    
    .piece.king::after {
        font-size: 16px;
    }
}

/* Jumping indicator */
.piece.can-jump {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.captured-pieces-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

/* Add these styles to your existing CSS file */

/* AI Move Animations */
.ai-move-from {
    background-color: #ffeaa7 !important;
    animation: pulseFrom 1s ease-in-out;
    border: 2px solid #fdcb6e;
}

.ai-move-to {
    background-color: #a8e6cf !important;
    animation: pulseTo 1s ease-in-out;
    border: 2px solid #00b894;
}

@keyframes pulseFrom {
    0%, 100% { 
        background-color: #ffeaa7;
        transform: scale(1);
    }
    50% { 
        background-color: #fdcb6e;
        transform: scale(1.02);
    }
}

@keyframes pulseTo {
    0%, 100% { 
        background-color: #a8e6cf;
        transform: scale(1);
    }
    50% { 
        background-color: #00b894;
        transform: scale(1.02);
    }
}

@keyframes capturedPiece {
    0% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2) rotate(180deg);
        opacity: 0.5;
    }
    100% { 
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* AI Feedback and Turn Update CSS */

/* AI Thinking Overlay */
.ai-thinking-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(108, 92, 231, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

.ai-thinking-content {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
    border: 2px solid #6c5ce7;
}

.ai-brain {
    font-size: 3rem;
    animation: brainPulse 1.5s ease-in-out infinite;
    margin-bottom: 10px;
}

.ai-thinking-text {
    font-weight: 600;
    color: #6c5ce7;
    margin-bottom: 5px;
}

.ai-difficulty-hint {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

@keyframes brainPulse {
    0%, 100% {
        transform: scale(1);
        filter: hue-rotate(0deg);
    }
    50% {
        transform: scale(1.1);
        filter: hue-rotate(20deg);
    }
}

/* Turn Indicator Animations */
.human-turn.pulse {
    animation: humanTurnPulse 2s ease-in-out infinite;
}

@keyframes humanTurnPulse {
    0%, 100% {
        background: linear-gradient(45deg, #28a745, #20c997) !important;
        transform: scale(1);
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
    }
    50% {
        background: linear-gradient(45deg, #20c997, #17a2b8) !important;
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
    }
}

.ai-turn {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe) !important;
    animation: aiTurnGlow 3s ease-in-out infinite;
}

@keyframes aiTurnGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(108, 92, 231, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    }
}

@keyframes turnChange {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* AI Thinking States */
.ai-thinking.bg-info {
    background: linear-gradient(45deg, #17a2b8, #20c997) !important;
}

.ai-thinking.bg-warning {
    background: linear-gradient(45deg, #ffc107, #fd7e14) !important;
    animation: thinkingWarning 1s ease-in-out infinite;
}

.ai-thinking.bg-danger {
    background: linear-gradient(45deg, #dc3545, #e83e8c) !important;
    animation: thinkingDanger 0.8s ease-in-out infinite;
}

@keyframes thinkingWarning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes thinkingDanger {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

/* Move Notifications */
.ai-move-notification,
.move-complete-notification,
.ai-error-notification {
    z-index: 1050;
}

.ai-move-notification .alert {
    border-left: 5px solid #6c5ce7;
    animation: slideInRight 0.5s ease-out;
}

.move-complete-notification .alert {
    border-left: 5px solid #28a745;
    animation: slideInRight 0.3s ease-out;
}

.ai-error-notification .alert {
    border-left: 5px solid #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Board thinking state */
.checkers-board.thinking {
    filter: grayscale(20%);
    transition: all 0.3s ease;
}

/* Spinner enhancements */
.spinner-border-sm {
    animation: spin 1s linear infinite, colorChange 2s ease-in-out infinite;
}

@keyframes colorChange {
    0%, 100% { border-top-color: currentColor; }
    33% { border-top-color: #fff; }
    66% { border-top-color: rgba(255,255,255,0.7); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ai-thinking-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .ai-thinking-content {
        margin: 20px;
        padding: 15px;
    }

    .ai-brain {
        font-size: 2rem;
    }

    .move-complete-notification .alert,
    .ai-move-notification .alert {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        margin: 0 !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ai-thinking-overlay {
        background: rgba(0, 0, 0, 0.8);
    }

    .ai-thinking-content {
        border: 3px solid #000;
        background: #fff;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ai-brain,
    .human-turn.pulse,
    .ai-turn,
    .ai-thinking.bg-warning,
    .ai-thinking.bg-danger,
    .spinner-border-sm {
        animation: none;
    }

    @keyframes turnChange {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.8; }
    }
}
