/* Game Page Styles - Modern Design */

/* Variables for consistent theming */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --dark-overlay: rgba(0, 0, 0, 0.1);
    --light-overlay: rgba(255, 255, 255, 0.95);
    --shadow-primary: 0 10px 30px rgba(102, 126, 234, 0.3);
    --shadow-hover: 0 15px 40px rgba(102, 126, 234, 0.4);
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --warning-color: #ff6b6b;
    --success-color: #51cf66;
    --active-color: #40c057;
    --inactive-color: #868e96;
}

.game-container {
    background: var(--primary-gradient);
    min-height: 100vh;
    padding: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.game-board-container {
    background: var(--light-overlay);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-primary);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto;
    max-width: 1400px;
}

.game-board-header {
    background: var(--primary-gradient);
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-info {
    flex: 1;
}

.board-title {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Dual Timer System Styles */
.players-timers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.player-timer-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.player-timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.player-icon {
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.black-piece {
    background: linear-gradient(135deg, #2d3748, #4a5568);
}

.white-piece {
    background: linear-gradient(135deg, #f7fafc, #e2e8f0);
}

.player-name {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex: 1;
    margin-left: 0.75rem;
}

.player-status {
    font-size: 0.9rem;
}

.status-active {
    color: var(--active-color);
    font-weight: 700;
    animation: pulse 2s infinite;
}

.status-waiting {
    color: var(--inactive-color);
    font-weight: 600;
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 60px;
}

.vs-text {
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.timer-display {
    text-align: center;
}

.timer-active {
    transform: scale(1.05);
    border-color: var(--active-color) !important;
    box-shadow: 0 0 20px rgba(64, 192, 87, 0.3);
}

.timer-inactive {
    opacity: 0.7;
    transform: scale(0.95);
}

.timer-value {
    color: white;
    font-weight: 800;
    font-size: 1.8rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timer-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--active-color), #69db7c);
    border-radius: 4px;
    transition: width 1s linear, background-color 0.3s ease;
    width: 100%;
}

/* Timer Warning States */
.timer-warning {
    animation: timerPulse 1s infinite;
}

.timer-value.timer-warning {
    color: var(--warning-color) !important;
}

.timer-progress-bar.timer-warning {
    background: linear-gradient(90deg, var(--warning-color), #ff8787) !important;
}

.timer-value.timer-expired {
    color: var(--warning-color) !important;
    animation: timerExpired 0.5s infinite;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes timerExpired {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.game-actions {
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-new-game {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    text-decoration: none;
    font-size: 1rem;
    min-width: 140px;
    white-space: nowrap;
}

.btn-new-game:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.game-board-content {
    padding: 3rem;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.board-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 750px;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    width: 100%;
}

.btn-game-action {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn-game-action.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-game-action:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

.btn-game-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Stats Modal Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--border-radius);
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

.stat-info h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.stat-info p {
    margin: 0;
    color: #4a5568;
    font-weight: 500;
}

/* Animation for page load */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
    .game-container {
        padding: 15px;
    }
    
    .game-board-content {
        padding: 2rem;
    }
    
    .board-wrapper {
        max-width: 650px;
    }
    
    .board-title {
        font-size: 1.8rem;
    }
    
    .players-timers {
        gap: 1.5rem;
    }
    
    .timer-value {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-board-header {
        padding: 1.5rem;
    }
    
    .game-board-header .d-flex {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .board-wrapper {
        max-width: 100%;
    }
    
    .game-square {
        font-size: 28px;
    }
    
    .square-wrapper {
        width: 70px !important;
        height: 70px !important;
    }
    
    .players-timers {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }
    
    .vs-divider {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    .vs-text {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    .player-timer-container {
        width: 100%;
        padding: 1.25rem;
    }
    
    .player-timer-header {
        justify-content: center;
        text-align: center;
    }
    
    .player-name {
        margin-left: 0.5rem;
        font-size: 1rem;
    }
    
    .timer-value {
        font-size: 1.4rem;
    }
    
    .board-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .game-board-content {
        padding: 1.5rem;
        gap: 2rem;
    }
    
    .game-actions {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        align-items: stretch;
    }
    
    .btn-new-game {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .game-controls {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .btn-game-action {
        padding: 0.875rem 1.5rem;
        width: 100%;
        max-width: 280px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .game-board-header {
        padding: 1rem;
    }
    
    .board-title {
        font-size: 1.4rem;
    }
    
    .game-board-content {
        padding: 1rem;
    }
    
    .game-square {
        font-size: 24px;
    }
    
    .square-wrapper {
        width: 60px !important;
        height: 60px !important;
    }
    
    .game-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .btn-new-game {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 250px;
        min-width: auto;
    }
    
    .btn-game-action {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
    
    .player-timer-container {
        padding: 1rem;
    }
    
    .timer-value {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .player-timer-header {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .game-container {
        padding: 10px 0;
    }
    
    .game-board-header {
        padding: 1rem 1.5rem;
    }
    
    .game-board-content {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .players-timers {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .vs-divider {
        flex-direction: column;
        min-width: 50px;
    }
    
    .player-timer-container {
        max-width: 280px;
    }
    
    .game-actions {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .btn-new-game {
        width: auto;
        min-width: 140px;
        max-width: none;
        margin: 0;
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn-game-action {
        width: auto;
        min-width: 140px;
    }
}

/* Ultra-wide screen optimization */
@media (min-width: 1400px) {
    .board-wrapper {
        max-width: 900px;
    }
    
    .game-board-content {
        padding: 4rem;
    }
    
    .players-timers {
        max-width: 900px;
        gap: 3rem;
    }
    
    .timer-value {
        font-size: 2rem;
    }
}

/* Game Page Split Layout Styles */

.game-header {
    background: var(--background-light);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-primary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-title-section {
    flex: 1;
}

.game-title {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-content {
    margin-bottom: 2rem;
}

.game-board-section {
    background: var(--background-light);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.players-timers-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    gap: 1rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.phase-info {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}

.game-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-stats {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-stats:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Sidebar Styles */
.sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.move-history-section,
.game-info-panel {
    background: var(--background-light);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.section-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.move-count {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
}

.move-history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.move-history-list::-webkit-scrollbar {
    width: 6px;
}

.move-history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.move-history-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.no-moves-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

.no-moves-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-moves-message p {
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.no-moves-message small {
    opacity: 0.7;
}

.move-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.move-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
}

.move-item.latest-move {
    border-left-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    animation: newMoveSlide 0.5s ease-out;
}

.move-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.move-number {
    background: var(--primary-gradient);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.move-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    margin: 0 1rem;
}

.piece-type {
    font-size: 1.2rem;
}

.player-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.move-time {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    flex-shrink: 0;
}

.move-details {
    margin-left: 0;
}

.move-action {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.move-notation {
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 700;
    margin-left: 0.5rem;
}

.move-description {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Game Info Panel */
.game-info-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
}

.info-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.info-value {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 700;
    text-align: right;
}

/* Animations */
@keyframes newMoveSlide {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile-First Responsive Design */
@media (max-width: 1200px) {
    .players-timers-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vs-divider {
        order: -1;
        transform: rotate(90deg);
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px 0;
    }
    
    .game-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .game-title {
        font-size: 1.5rem;
        justify-content: center;
    }
    
    .header-actions {
        justify-content: center;
        width: 100%;
    }
    
    .game-content .row {
        flex-direction: column-reverse;
    }
    
    .game-board-section {
        padding: 1rem;
    }
    
    .players-timers-section {
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 1rem;
    }
    
    .player-timer-container {
        flex: 1;
        margin: 0 0.5rem;
    }
    
    .vs-divider {
        transform: none;
        order: 0;
        flex-shrink: 0;
    }
    
    .game-status-bar {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .sidebar-container {
        margin-bottom: 1rem;
    }
    
    .move-history-section,
    .game-info-panel {
        padding: 1rem;
    }
    
    .move-history-list {
        max-height: 250px;
    }
    
    .move-item {
        padding: 0.75rem;
    }
    
    .move-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .move-player {
        margin: 0;
        order: 1;
        flex: 1;
    }
    
    .move-time {
        order: 2;
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.3rem;
    }
    
    .player-timer-container {
        margin: 0 0.25rem;
    }
    
    .timer-value {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .move-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .piece-type {
        font-size: 1rem;
    }
    
    .player-name {
        font-size: 0.8rem;
    }
    
    .info-label,
    .info-value {
        font-size: 0.8rem;
    }
    
    .btn-new-game,
    .btn-stats {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
} 