/* =============================================
   Avatar IA Platform - Shared Styles
   Kids-friendly, gamified, glassmorphism
   ============================================= */

:root {
    --bg-dark: #0a0a1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(100, 200, 255, 0.3);
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);
    --accent-blue: #64c8ff;
    --accent-purple: #b464ff;
    --accent-green: #4ade80;
    --accent-yellow: #ffc864;
    --accent-red: #f87171;
    --accent-orange: #fb923c;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === GLASS CARD === */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.glass:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

/* === TOP HEADER === */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-name {
    font-size: 15px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* === LEVEL BADGE === */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(100, 200, 255, 0.12);
    color: var(--accent-blue);
    border-radius: var(--radius-full);
    border: 1px solid rgba(100, 200, 255, 0.2);
}

/* === XP BAR === */
.xp-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xp-bar {
    width: 80px;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.xp-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-purple);
}

/* === STREAK === */
.streak {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 200, 100, 0.1);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 200, 100, 0.2);
}

.streak-fire {
    font-size: 16px;
    animation: fireFlicker 1s ease infinite;
}

.streak-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-yellow);
}

@keyframes fireFlicker {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(5deg); }
}

/* === MAIN CONTENT === */
.main {
    padding: 20px;
    padding-bottom: 80px;
    max-width: 600px;
    margin: 0 auto;
}

/* === SECTION TITLE === */
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    margin-top: 24px;
}

/* === SKILL TREE GRID === */
.skill-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skill-card.locked {
    opacity: 0.4;
    pointer-events: none;
}

.skill-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(100, 200, 255, 0.1);
    flex-shrink: 0;
}

.skill-info {
    flex: 1;
    min-width: 0;
}

.skill-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.skill-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.skill-stars {
    display: flex;
    gap: 3px;
    margin-top: 6px;
}

.star {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.star.filled {
    background: var(--accent-yellow);
    box-shadow: 0 0 8px rgba(255, 200, 100, 0.4);
}

.skill-arrow {
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0;
}

/* === CONVERSATION CARD === */
.conv-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
    border: 1px solid rgba(180, 100, 255, 0.2);
    background: rgba(180, 100, 255, 0.05);
    transition: all 0.3s ease;
}

.conv-card:hover {
    background: rgba(180, 100, 255, 0.1);
    border-color: rgba(180, 100, 255, 0.4);
    transform: translateY(-2px);
}

.conv-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.conv-info { flex: 1; }

.conv-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.conv-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 4px 16px;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: var(--accent-blue);
}

.nav-icon {
    font-size: 22px;
}

/* === BUTTON === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(100, 200, 255, 0.2);
}

.btn-ghost {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* === INPUT === */
.input {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s ease;
}

.input:focus {
    border-color: var(--accent-blue);
}

.input::placeholder {
    color: var(--text-muted);
}

/* === FORM === */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* === LOADING === */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === TOAST / ERROR === */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.4s ease;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--accent-green);
}

.toast.error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--accent-red);
}

/* === RESPONSIVE === */
@media (max-width: 400px) {
    .header { padding: 12px 16px; }
    .main { padding: 16px; padding-bottom: 80px; }
    .xp-bar { width: 60px; }
}
