/* 
 * SudokuLingo Design System - Premium Dark Glassmorphic Theme
 * Tailored custom HSL colors, responsive design, animations, and beautiful effects.
 */

:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #131722;
    --accent-glow: hsla(271, 76%, 53%, 0.15);
    --primary-color: hsl(265, 89%, 66%);
    --primary-hover: hsl(265, 89%, 72%);
    --secondary-color: hsl(190, 90%, 50%);
    --text-primary: #f0f2f5;
    --text-secondary: #9aa0a6;
    --glass-bg: rgba(25, 30, 45, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --danger-color: hsl(354, 85%, 60%);
    --success-color: hsl(145, 63%, 49%);
    --warning-color: hsl(38, 92%, 50%);
    --xp-color: hsl(43, 96%, 56%);
    --streak-color: hsl(14, 98%, 57%);
    --heart-color: hsl(352, 90%, 55%);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at 50% 50%, var(--bg-secondary), var(--bg-primary));
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Glassmorphism Containers */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-container:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}

/* Typography & Glows */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

.glow-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.4));
}

/* Inputs & Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: rgba(10, 12, 16, 0.5);
    border: 1.5px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), hsl(265, 89%, 60%));
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: transform 0.5s ease;
}

.btn-glow:hover::after {
    transform: translate(50%, 50%) rotate(45deg);
}

/* Navigation bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: rgba(10, 12, 16, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

/* Gamification Badges */
.gamification-badges {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-xp { color: var(--xp-color); }
.badge-streak { color: var(--streak-color); }
.badge-lives { color: var(--heart-color); }

/* Dashboard layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    padding: 2.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.welcome-card {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.puzzle-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.puzzle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.8rem;
    transition: all 0.25s ease;
}

.puzzle-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.difficulty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.difficulty-easy { background: rgba(34, 197, 94, 0.15); color: var(--success-color); }
.difficulty-medium { background: rgba(234, 179, 8, 0.15); color: var(--warning-color); }
.difficulty-hard { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }

/* Sudoku Game Page */
.game-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2.5rem;
    padding: 2.5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.sudoku-cell {
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    background: transparent;
    color: var(--secondary-color);
    outline: none;
}

/* Thicker borders for 3x3 blocks */
.border-right-thick { border-right: 3.5px solid var(--primary-color); }
.border-bottom-thick { border-bottom: 3.5px solid var(--primary-color); }

.sudoku-cell.original {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.sudoku-cell:focus, .sudoku-cell.selected {
    background: rgba(168, 85, 247, 0.25) !important;
    box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.5);
}

.sudoku-cell.highlighted {
    background: rgba(168, 85, 247, 0.08);
}

.sudoku-cell.wrong-cell {
    color: var(--danger-color) !important;
    background: rgba(239, 68, 68, 0.15);
    animation: shake 0.3s ease;
}

/* Game controls and keypad */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.num-btn {
    padding: 1.1rem;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.num-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Helper styles for centered auth flow page */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 2rem;
}

.auth-box {
    width: 100%;
    max-width: 450px;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-footer-link {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.floating-icon {
    animation: float 4s ease-in-out infinite;
}

/* Footer style */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}
