/**
 * styles.css
 * Elegant and minimalist styling for 2.5D Go
 */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Layout */
.game-layout {
    display: flex;
    gap: 30px;
    padding: 30px;
    background: var(--background-color);
}

.sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

/* Panel styling */
.info-panel,
.controls-panel,
.rules-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.info-panel h2,
.controls-panel h2,
.rules-panel h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

/* Info panel */
.current-player,
.move-count,
.captures {
    margin-bottom: 12px;
}

.label {
    font-weight: 500;
    color: var(--secondary-color);
    margin-right: 8px;
}

.player-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.player-indicator.black {
    background: #000;
    color: white;
}

.player-indicator.white {
    background: #fff;
    color: #000;
    border: 2px solid #666;
}

.captures {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.capture-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.stone {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.black-stone-small {
    background: #000;
}

.white-stone-small {
    background: #fff;
    border: 2px solid #666;
}

/* Controls */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #d5dbdb;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.option {
    margin-top: 8px;
    padding: 8px 0;
}

.option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option select {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

/* Rules panel */
.rules-panel ul {
    list-style: none;
    padding: 0;
}

.rules-panel li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rules-panel li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Board styling */
.layer-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
}

.board-svg {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.board-svg:hover {
    box-shadow: var(--shadow-hover);
}

/* Game message */
.game-message {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    font-size: 1rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.game-message.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
    }

    .sidebar {
        flex: none;
        width: 100%;
    }

    .board-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .game-layout {
        padding: 20px;
        gap: 20px;
    }

    .board-svg {
        max-width: 100%;
        height: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.board-svg {
    animation: fadeIn 0.5s ease;
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .sidebar {
        display: none;
    }

    header {
        background: white;
        color: var(--text-color);
    }
}
