/* ==================== GLOBAL VARIABLES & BASE ==================== */
:root {
    --bg-dark: #070a13;
    --bg-card: rgba(16, 22, 42, 0.65);
    --bg-card-hover: rgba(24, 32, 58, 0.8);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-bright: rgba(255, 255, 255, 0.12);
    
    --color-primary: #5c62f9;
    --color-gold: #ffbe1a;
    --color-gold-glow: rgba(255, 190, 26, 0.35);
    --color-green: #00f299;
    --color-green-glow: rgba(0, 242, 153, 0.3);
    --color-red: #ff4a5a;
    --color-red-glow: rgba(255, 74, 90, 0.3);
    --color-purple: #c54bfd;
    --color-cyan: #00d2ff;
    
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 20%, rgba(92, 98, 249, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(197, 75, 253, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(0, 210, 255, 0.05) 0px, transparent 60%);
    background-attachment: fixed;
    color: #f1f5f9;
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== LAYOUT & CONTAINERS ==================== */
.app-container {
    width: 100%;
    max-width: 1200px;
    min-height: 80vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
}

.glass:hover {
    border-color: var(--border-glass-bright);
}

.glass-inner {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
}

/* Screen visibility states */
.screen {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Audio control toggle */
.audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    transition: var(--transition-bounce);
    color: var(--color-gold);
}

.audio-control:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

.audio-control:active {
    transform: scale(0.9);
}

.audio-icon.hidden {
    display: none;
}

/* ==================== SCREEN 1: LOGIN CARD ==================== */
.login-card {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    text-align: center;
}

.illustration-container {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-banner {
    width: 100%;
    height: auto;
    display: block;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.sub-text {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* PIN dots display */
.pin-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition-bounce);
}

.pin-dot.filled {
    background: var(--color-gold);
    border-color: var(--color-gold);
    box-shadow: 0 0 15px var(--color-gold-glow);
    transform: scale(1.2);
}

/* PIN keyboard */
.pin-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.key-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 15px 0;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-bounce);
    outline: none;
    user-select: none;
}

.key-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.key-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.15);
}

.key-btn.action-btn {
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.key-btn.action-btn.delete {
    color: var(--color-red);
}

.key-btn.action-btn.clear {
    color: var(--color-cyan);
}

.error-text {
    color: var(--color-red);
    font-size: 0.9rem;
    margin-top: 15px;
    font-weight: 500;
}

.badge-setup {
    background: rgba(92, 98, 249, 0.15);
    border: 1px solid rgba(92, 98, 249, 0.3);
    color: #a5b4fc;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 10px;
    margin-top: 15px;
    display: inline-block;
}

.hidden {
    display: none !important;
}

/* ==================== SCREEN 2: MAIN DASHBOARD ==================== */

/* App Header */
.app-header {
    width: 100%;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.05);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
}

.welcome-title span {
    color: var(--color-gold);
}

.header-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
}

.header-right {
    display: flex;
    gap: 12px;
}

.header-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-bounce);
}

.header-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.header-btn.parent-portal-btn {
    color: var(--color-cyan);
    border-color: rgba(0, 210, 255, 0.2);
}

.header-btn.parent-portal-btn:hover {
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.15);
    background: rgba(0, 210, 255, 0.05);
}

.header-btn.logout-btn {
    color: var(--color-red);
    border-color: rgba(255, 74, 90, 0.2);
}

.header-btn.logout-btn:hover {
    box-shadow: 0 0 15px rgba(255, 74, 90, 0.15);
    background: rgba(255, 74, 90, 0.05);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    align-items: start;
}

.grid-card-span-2 {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.grid-card-span-1 {
    grid-column: span 1;
}

.flex-col-gap {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Balance Card */
.balance-card {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.balance-card.gold-glow {
    border-color: rgba(255, 190, 26, 0.15);
    box-shadow: 0 0 40px rgba(255, 190, 26, 0.08), inset 0 0 20px rgba(255, 190, 26, 0.03);
}

.balance-info {
    z-index: 2;
}

.balance-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    color: var(--color-gold);
    font-weight: 600;
}

.balance-amount-container {
    display: flex;
    align-items: flex-start;
    margin-top: 5px;
    margin-bottom: 10px;
}

.currency-symbol {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-top: 5px;
    margin-right: 2px;
}

.balance-value {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.balance-growth-sub {
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.balance-growth-sub strong {
    color: var(--color-green);
}

/* Floating Robot Piggy Bank */
.piggy-container {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.piggy-body {
    font-size: 4.5rem;
    animation: float 4s ease-in-out infinite;
    cursor: pointer;
    transition: var(--transition-bounce);
    user-select: none;
}

.piggy-body:hover {
    transform: scale(1.15) rotate(5deg);
}

.piggy-body:active {
    transform: scale(0.9) rotate(-5deg);
}

.piggy-coin {
    position: absolute;
    font-size: 1.8rem;
    top: -20px;
    animation: coinDrop 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    pointer-events: none;
    z-index: -1;
}

/* Quick Action Buttons Group */
.action-buttons-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.action-btn {
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition-bounce);
    border: 1px solid var(--border-glass);
    text-align: left;
}

.action-btn.deposit-btn {
    background: linear-gradient(135deg, rgba(0, 242, 153, 0.05) 0%, rgba(92, 98, 249, 0.05) 100%);
    border-color: rgba(0, 242, 153, 0.15);
}

.action-btn.deposit-btn:hover {
    border-color: rgba(0, 242, 153, 0.35);
    background: linear-gradient(135deg, rgba(0, 242, 153, 0.12) 0%, rgba(92, 98, 249, 0.12) 100%);
    box-shadow: 0 0 20px var(--color-green-glow);
    transform: translateY(-3px);
}

.action-btn.spend-btn {
    background: linear-gradient(135deg, rgba(255, 74, 90, 0.05) 0%, rgba(197, 75, 253, 0.05) 100%);
    border-color: rgba(255, 74, 90, 0.15);
}

.action-btn.spend-btn:hover {
    border-color: rgba(255, 74, 90, 0.35);
    background: linear-gradient(135deg, rgba(255, 74, 90, 0.12) 0%, rgba(197, 75, 253, 0.12) 100%);
    box-shadow: 0 0 20px var(--color-red-glow);
    transform: translateY(-3px);
}

.action-btn:active {
    transform: scale(0.97);
}

.btn-icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.04);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-label-box {
    display: flex;
    flex-direction: column;
}

.btn-primary-txt {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #fff;
    font-weight: 600;
}

.btn-secondary-txt {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* ==================== GOALS SECTION ==================== */
.goals-section {
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: #f1f5f9;
}

.add-goal-btn {
    background: rgba(92, 98, 249, 0.15);
    border: 1px solid rgba(92, 98, 249, 0.3);
    color: #a5b4fc;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.add-goal-btn:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.goals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.goal-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.goal-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
}

.goal-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.goal-emoji {
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.04);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.goal-info {
    flex-grow: 1;
}

.goal-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.goal-price {
    font-size: 0.8rem;
    color: #94a3b8;
}

.goal-price span {
    color: var(--color-gold);
    font-weight: 600;
}

/* Progress bar system */
.goal-progress-box {
    margin-top: 5px;
}

.goal-progress-bar-bg {
    background: rgba(255, 255, 255, 0.05);
    height: 10px;
    border-radius: 10px;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.goal-progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-cyan) 100%);
    transition: width 0.8s ease-in-out;
}

.goal-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 6px;
    color: #94a3b8;
}

.goal-percent {
    color: var(--color-green);
    font-weight: 600;
}

.goal-card.completed .goal-progress-bar-fill {
    background: linear-gradient(90deg, var(--color-green) 0%, var(--color-cyan) 100%);
}

.goal-card.completed .goal-percent {
    color: var(--color-gold);
}

.goal-completed-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    background: rgba(255, 190, 26, 0.15);
    border: 1px solid rgba(255, 190, 26, 0.3);
    color: var(--color-gold);
    padding: 3px 6px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ==================== ACTIVITY LEDGER ==================== */
.ledger-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    max-height: 380px;
}

.ledger-list {
    margin-top: 15px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.ledger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition-smooth);
}

.ledger-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.ledger-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ledger-category-icon {
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.03);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ledger-details {
    display: flex;
    flex-direction: column;
}

.ledger-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.ledger-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 1px;
}

.ledger-amount {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
}

.ledger-amount.deposit {
    color: var(--color-green);
}

.ledger-amount.withdraw {
    color: var(--color-red);
}

.empty-state {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 40px 10px;
    font-style: italic;
}

/* ==================== HONOR BADGES ==================== */
.badges-card {
    padding: 25px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.badge-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    transition: var(--transition-bounce);
    cursor: help;
    position: relative;
}

.badge-emoji {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
    transition: var(--transition-bounce);
}

.badge-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-item.locked {
    opacity: 0.35;
    filter: grayscale(1);
    background: rgba(0, 0, 0, 0.1);
}

.badge-item.locked::after {
    content: "🔒";
    position: absolute;
    font-size: 0.8rem;
    top: 5px;
    right: 5px;
    opacity: 0.8;
}

.badge-item:not(.locked) {
    background: rgba(255, 190, 26, 0.03);
    border-color: rgba(255, 190, 26, 0.15);
    box-shadow: 0 4px 12px rgba(255, 190, 26, 0.03);
}

.badge-item:not(.locked) .badge-emoji {
    filter: drop-shadow(0 0 10px var(--color-gold-glow));
    transform: scale(1.1);
}

.badge-item:not(.locked) .badge-name {
    color: var(--color-gold);
}

.badge-item:not(.locked):hover {
    transform: translateY(-4px) scale(1.05);
    border-color: rgba(255, 190, 26, 0.4);
    box-shadow: 0 6px 15px rgba(255, 190, 26, 0.1);
}

/* ==================== MODALS & BACKDROP ==================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-card.parent-portal-card {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition-smooth);
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.text-center {
    text-align: center;
}

.justify-center {
    justify-content: center !important;
}

/* Form Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 500;
}

.input-label-sm {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.tx-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-currency-symbol {
    position: absolute;
    left: 15px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-gold);
}

input[type="number"], input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.tx-input-container input[type="number"] {
    padding-left: 30px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
}

input[type="number"]:focus, input[type="text"]:focus {
    border-color: rgba(92, 98, 249, 0.5);
    box-shadow: 0 0 10px rgba(92, 98, 249, 0.15);
}

/* Category Grid Selector */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.category-option {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px 5px;
    color: #cbd5e1;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: var(--transition-bounce);
}

.category-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.category-option-emoji {
    font-size: 1.5rem;
}

.category-option.active {
    background: rgba(92, 98, 249, 0.12);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(92, 98, 249, 0.15);
}

/* Emoji Selector for Goal */
.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emoji-option {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.emoji-option.active {
    background: rgba(255, 190, 26, 0.15);
    border-color: var(--color-gold);
    color: #fff;
}

/* Goal Manage Layout */
.goal-modal-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 5px;
}

.goal-modal-emoji {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.04);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#manage-goal-saved-text {
    color: var(--color-green);
    font-weight: 600;
}

#manage-goal-target-text {
    color: var(--color-gold);
    font-weight: 600;
}

/* Modal Footer Buttons */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.flex-space-between {
    justify-content: space-between;
}

.flex-row-gap-sm {
    display: flex;
    gap: 10px;
}

.modal-btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-bounce);
    border: 1px solid transparent;
}

.modal-btn.cancel-btn {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.modal-btn.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.modal-btn.confirm-btn {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(92, 98, 249, 0.3);
}

.modal-btn.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 98, 249, 0.4);
    filter: brightness(1.1);
}

.modal-btn.delete-btn {
    background: rgba(255, 74, 90, 0.1);
    border-color: rgba(255, 74, 90, 0.2);
    color: var(--color-red);
}

.modal-btn.delete-btn:hover {
    background: var(--color-red);
    color: #fff;
    transform: translateY(-2px);
}

.modal-btn:active {
    transform: scale(0.96);
}

/* ==================== PARENT LOCK LOCK CARD ==================== */
.math-lock-card {
    max-width: 380px;
}

.math-lock-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.math-challenge {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-cyan);
    margin: 15px 0;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
}

/* ==================== PARENT PORTAL CARD & SETTINGS ==================== */
.parent-portal-desc {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.parent-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.parent-settings-grid .span-2 {
    grid-column: span 2;
}

.parent-section h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-cyan);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.4;
}

.input-group-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group-row input[type="number"] {
    width: 80px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px;
}

.input-unit {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.parent-apply-btn {
    background: var(--color-cyan);
    color: #070a13;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.parent-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.parent-adjustment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.parent-adjustment-form .input-group {
    gap: 4px;
}

.parent-adjustment-form input[type="number"],
.parent-adjustment-form input[type="text"] {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.button-row {
    display: flex;
    gap: 10px;
}

.parent-action-btn {
    flex: 1;
    border: 1px solid transparent;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.parent-action-btn.deduct {
    background: rgba(255, 74, 90, 0.1);
    border-color: rgba(255, 74, 90, 0.2);
    color: var(--color-red);
}

.parent-action-btn.deduct:hover {
    background: var(--color-red);
    color: #fff;
    transform: translateY(-2px);
}

.parent-action-btn.award {
    background: rgba(0, 242, 153, 0.1);
    border-color: rgba(0, 242, 153, 0.2);
    color: var(--color-green);
}

.parent-action-btn.award:hover {
    background: var(--color-green);
    color: #070a13;
    transform: translateY(-2px);
}

.system-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.system-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-action-row h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.parent-danger-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-bounce);
    border: 1px solid transparent;
}

.parent-danger-btn.outline {
    background: none;
    border-color: rgba(255, 74, 90, 0.3);
    color: var(--color-red);
}

.parent-danger-btn.outline:hover {
    background: rgba(255, 74, 90, 0.1);
    border-color: var(--color-red);
    transform: translateY(-2px);
}

.parent-danger-btn.filled {
    background: var(--color-red);
    color: #fff;
}

.parent-danger-btn.filled:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 74, 90, 0.3);
}

/* ==================== ANIMATIONS ==================== */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes coinDrop {
    0% {
        transform: translateY(-40px) scale(0.2) rotate(0deg);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    70% {
        transform: translateY(20px) scale(1) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(50px) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

.shake {
    animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.popup-anim {
    animation: popupAnim 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popupAnim {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-card-span-2, .grid-card-span-1 {
        grid-column: span 1;
    }
    
    .app-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .parent-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .parent-settings-grid .span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 500px) {
    .goals-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons-group {
        grid-template-columns: 1fr;
    }
    
    .balance-card {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .balance-amount-container {
        justify-content: center;
    }
    
    .currency-symbol {
        font-size: 1.5rem;
    }
    
    .balance-value {
        font-size: 3rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
}
