/* Font settings */
body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    overflow-x: hidden;
}

.font-geist-mono {
    font-family: monospace;
    letter-spacing: -0.03em;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Bike learning animation */
.learning-stage {
    transition: opacity 0.8s ease;
    width: 100%;
    text-align: center;
}

.bike-rider {
    width: 80px;
    height: 80px;
    background-color: #f3f4f6;
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.bike-rider:before {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: #3b82f6;
    border-radius: 50%;
    top: 20px;
    left: 25px;
}

.bike-rider:after {
    content: "";
    position: absolute;
    width: 60px;
    height: 2px;
    background-color: #6b7280;
    bottom: 20px;
    left: 10px;
}

.bike-rider.fall {
    transform: rotate(45deg);
}

.bike-rider.wobbly {
    animation: wobble 1s infinite;
}

.bike-rider.success {
    animation: smooth 3s infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

@keyframes smooth {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* Learning process animation */
.learning-process-animation {
    overflow: hidden;
}

#agent-character {
    transition: left 0.8s ease, top 0.8s ease;
    z-index: 10;
}

#thought-bubble, #reward-indicator {
    transition: opacity 0.5s ease;
}

/* Maze styling */
.maze-cell {
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maze-wall {
    background-color: #1f2937;
}

.maze-start {
    background-color: #dbeafe;
}

.maze-goal {
    background-color: #dcfce7;
}

.maze-agent {
    background-color: #3b82f6;
    border-radius: 50%;
    width: 70%;
    height: 70%;
}

.maze-reward {
    position: absolute;
    top: -20px;
    animation: float-up 0.8s ease-out forwards;
    font-weight: bold;
    font-size: 12px;
    pointer-events: none;
}

@keyframes float-up {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Cart-pole styling */
#cartpole-canvas {
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.pole {
    fill: #6b7280;
}

.cart {
    fill: #3b82f6;
}

.track {
    stroke: #d1d5db;
    stroke-width: 2;
}

/* TicTacToe styling */
#tictactoe-board {
    transition: opacity 0.3s ease;
}

.ttt-cell {
    transition: all 0.2s ease;
}

.ttt-cell:hover:not(.marked) {
    background-color: #f3f4f6;
}

.ttt-cell.marked {
    cursor: not-allowed;
}

.ttt-cell.highlight {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { background-color: white; }
    50% { background-color: #dbeafe; }
}

.feedback-btn {
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    transform: translateY(-2px);
}

/* Gridworld styling */
#gridworld-grid {
    position: relative;
}

.grid-cell {
    position: relative;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.grid-cell:hover {
    background-color: #f3f4f6;
    cursor: pointer;
}

.grid-cell.start {
    background-color: #dbeafe;
}

.grid-cell.goal {
    background-color: #dcfce7;
}

.grid-cell.reward {
    background-color: #d1fae5;
}

.grid-cell.punishment {
    background-color: #fee2e2;
}

.grid-agent {
    position: absolute;
    width: 60%;
    height: 60%;
    background-color: #3b82f6;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s ease;
}

.reward-value, .punishment-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    z-index: 5;
}

.reward-value {
    color: #065f46;
}

.punishment-value {
    color: #b91c1c;
}

/* Maze editor */
.editor-cell {
    width: 30px;
    height: 30px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.editor-cell.wall {
    background-color: #1f2937;
}

.editor-cell.start {
    background-color: #dbeafe;
    cursor: move;
}

.editor-cell.goal {
    background-color: #dcfce7;
    cursor: move;
}

/* Left and right bars for CartPole */
#left-prob-bar, #right-prob-bar {
    float: left;
    transition: width 0.3s ease;
}
