/* Ember.Intelligence Sample - Ember Consult Brand Design */

:root {
    /* Light theme color palette - Ember Consult inspired */
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9fa;
    --bg-tertiary: #f5f5f6;
    --bg-elevated: #ffffff;
    --bg-hover: #f5f5f6;
    --bg-active: #eeeff1;
    --bg-sidebar: #f9f9fa;

    /* Gradient backgrounds - Ember Consult brand */
    --gradient-primary: linear-gradient(135deg, #A14090 0%, #D460A0 100%);
    --gradient-accent: linear-gradient(135deg, #77338C 0%, #A14090 100%);
    --gradient-subtle: linear-gradient(180deg, rgba(0, 0, 0, 0.01) 0%, transparent 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    --gradient-brand: linear-gradient(135deg, #812e91 0%, #D460A0 50%, #ed1066 100%);

    /* Text colors */
    --text-primary: #1a1d21;
    --text-secondary: #5c6370;
    --text-muted: #8b9199;
    --text-accent: #A14090;

    /* Border colors */
    --border-color: #e5e7eb;
    --border-subtle: #f0f1f4;
    --border-focus: #D460A0;

    /* Accent colors - Ember Consult Pink/Plum */
    --accent-primary: #D460A0;
    --accent-primary-hover: #C93888;
    --accent-secondary: #A14090;
    --accent-warning: #f59e0b;
    --accent-success: #10b981;
    --accent-error: #ef4444;
    --accent-purple: #77338C;
    --accent-orange: #f97316;

    /* Shadows - with brand color accent */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(212, 96, 160, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100%;
}

/* Scrollbar styling - light theme */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: rgba(212, 96, 160, 0.15);
    color: var(--text-primary);
}

/* Button base */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Markdown code block styling */
pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
}

pre code {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
    padding: 0;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

code {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Glass effect - light theme */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* Card styling */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

/* Glow effect */
.glow {
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   TicTacToe Game Styles (Global - for use in side panels)
   ========================================================================== */

.tictactoe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 16px;
    border: 1px solid var(--border-color, #e0e0e0);
    max-width: 320px;
    margin: 12px auto;
}

.tictactoe-message {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--bg-tertiary, #eee);
    color: var(--text-primary, #333);
}

.tictactoe-message.status-playerwins {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.tictactoe-message.status-aiwins {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tictactoe-message.status-draw {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: var(--border-color, #ccc);
    padding: 4px;
    border-radius: 12px;
}

.tictactoe-cell {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary, #fff);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.tictactoe-cell:hover:not(.cell-x):not(.cell-o) {
    background: var(--bg-tertiary, #f0f0f0);
}

.tictactoe-cell.cell-winning {
    background: rgba(34, 197, 94, 0.2);
    animation: winPulse 0.6s ease infinite alternate;
}

.tictactoe-cell.cell-last-ai {
    box-shadow: inset 0 0 0 2px var(--accent-primary, #d460a0);
}

.cell-content {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.cell-content-x {
    color: var(--accent-primary, #d460a0);
}

.cell-content-o {
    color: var(--accent-secondary, #6366f1);
}

.tictactoe-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-align: center;
}

.tictactoe-status.status-playerwins {
    color: #22c55e;
}

.tictactoe-status.status-aiwins {
    color: #ef4444;
}

.tictactoe-status.status-draw {
    color: #eab308;
}

@keyframes winPulse {
    from {
        background: rgba(34, 197, 94, 0.15);
    }

    to {
        background: rgba(34, 197, 94, 0.3);
    }
}

/* Larger size for side panel */
.tool-panel-content .tictactoe-container {
    max-width: none;
}

.tool-panel-content .tictactoe-cell {
    width: 80px;
    height: 80px;
}

.tool-panel-content .cell-content {
    font-size: 42px;
}

.tool-panel-content .tictactoe-board {
    gap: 6px;
    padding: 6px;
}