/* Base styles */
.min-h-screen {
    min-height: 100vh;
    background: linear-gradient(to bottom right, #f5f3ff, #eff6ff);
    padding: 1rem;
}

.max-w-6xl {
    max-width: 72rem;
    margin: 0 auto;
}

/* Flexbox utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid utilities */
.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

/* Spacing utilities */
.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

/* Typography */
.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-mono {
    font-family: ui-monospace, monospace;
}

.text-center {
    text-align: center;
}

/* Colors */
.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-800 {
    color: #1f2937;
}

.text-green-700 {
    color: #047857;
}

.text-green-800 {
    color: #065f46;
}

.text-blue-500 {
    color: #3b82f6;
}

.text-yellow-500 {
    color: #eab308;
}

/* Backgrounds */
.bg-white {
    background-color: #ffffff;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.bg-transparent {
    background-color: transparent;
}

/* Borders */
.border {
    border-width: 1px;
}

.border-2 {
    border-width: 2px;
}

.border-none {
    border: none;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-gray-800 {
    border-color: #1f2937;
}

.border-green-300 {
    border-color: #86efac;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

/* Shadows */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-green {
    background-color: #22c55e;
}

.btn-green:hover {
    background-color: #16a34a;
}

.btn-yellow {
    background-color: #eab308;
}

.btn-yellow:hover {
    background-color: #ca8a04;
}

.btn-gray {
    background-color: #6b7280;
}

.btn-gray:hover {
    background-color: #4b5563;
}

.btn-blue {
    background-color: #3b82f6;
}

.btn-blue:hover {
    background-color: #2563eb;
}

/* Form elements */
input[type="range"] {
    width: 100%;
    cursor: pointer;
}

select {
    cursor: pointer;
    outline: none;
}

/* Utilities */
.hidden {
    display: none;
}

.space-y-1>*+* {
    margin-top: 0.25rem;
}

.space-y-2>*+* {
    margin-top: 0.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

/* Maze specific styles */
.maze-cell {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #d1d5db;
}

.maze-wall {
    background-color: #1f2937;
}

.maze-player {
    background-color: #3b82f6;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.maze-target {
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(0.95);
    }
}

/* Responsive design */
@media (min-width: 1024px) {
    .lg-flex-row {
        flex-direction: row;
    }

    .lg-w-80 {
        width: 20rem;
    }
}

/* RTL support for Arabic */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .flex-between {
    flex-direction: row-reverse;
}

[dir="rtl"] .maze-cell {
    transform: scaleX(-1);
}