/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 5px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
    display: block;
}

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

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border: none;
}

/* Canvas Styles */
#canvasContainer {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

#drawingCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    cursor: crosshair;
}

#shapeContainer {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Shape Styles */
.shape {
    position: absolute;
    cursor: move;
    transition: all 0.3s ease;
    pointer-events: auto;
    border: 2px solid transparent;
    border-radius: 5px;
}

.shape:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.shape.selected {
    border-color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}

.shape.dragging {
    z-index: 1000;
    /* transform: scale(1.1); */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Button Styles */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Form Controls */
.form-control, .form-select, .form-range {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Chess Board Styles */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 480px;
    height: 480px;
    border: 4px solid #8B4513;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.chess-square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chess-square.light {
    background-color: #f0d9b5;
}

.chess-square.dark {
    background-color: #b58863;
}

.chess-square:hover {
    background-color: #7fb069 !important;
    transform: scale(1.05);
}

.chess-square.selected {
    background-color: #7fb069 !important;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.chess-square.possible-move {
    background-color: #87ceeb !important;
    position: relative;
}

.chess-square.possible-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

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

.chess-piece {
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.chess-piece:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chess-board {
        width: 320px;
        height: 320px;
    }
    
    .chess-square {
        font-size: 1.8rem;
    }
    
    #drawingCanvas {
        height: 400px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .chess-board {
        width: 280px;
        height: 280px;
    }
    
    .chess-square {
        font-size: 1.5rem;
    }
    
    #drawingCanvas {
        height: 300px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Animation Classes */
.animate-in {
    animation: slideInUp 0.5s ease-out;
}

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

.animate-out {
    animation: slideOutDown 0.3s ease-in;
}

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

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}

.transition-all {
    transition: all 0.3s ease;
}

