/* assets/style.css - Premium V2 */

:root {
    /* Modern Palette */
    --primary: #6C5CE7;
    --primary-dark: #5849be;
    --secondary: #a29bfe;
    --accent: #fd79a8;

    --success: #00b894;
    --success-bg: #E3FCEF;
    --warning: #fdcb6e;
    --warning-bg: #FFF7E6;
    --danger: #ff7675;
    --danger-bg: #FFEBE6;

    --bg-body: #F0F3F7;
    --surface: #FFFFFF;

    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-light: #b2bec3;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;

    --nav-height: 70px;
}

body {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    /* App-like feel */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

button {
    font-family: inherit;
    outline: none;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    line-height: 1.6;
    color: var(--text-muted);
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

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

.btn-block {
    display: block;
    width: 100%;
}

.mt-2 {
    margin-top: 1rem;
}

/* --- Buttons --- */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #E0E0E0;
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
}

/* --- Layout & Header --- */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    /* Glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.header-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-trigger {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f2f6;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
}

.menu-trigger:hover {
    background: #e0e0e0;
}

.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: 100px;
    /* Nav space */
    min-height: calc(100vh - var(--nav-height));
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Cards --- */
.section {
    margin-bottom: 2rem;
}

.section h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Child Card Specifics */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    /* More compact on mobile */
    gap: 16px;
}

.child-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    gap: 12px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 8px 16px rgba(108, 92, 231, 0.2);
    background-size: cover;
    background-position: center;
}

.add-card {
    border: 2px dashed #dcdde1;
    background: transparent;
    box-shadow: none;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
}

.add-card:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

/* --- Task List Row (Premium) --- */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card-row {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.task-info h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

/* Status Colors (Left Border + Bg Tint) */
.done-full {
    border-left: 4px solid var(--success);
    background: linear-gradient(to right, var(--success-bg), white 20%);
}

.done-second {
    border-left: 4px solid var(--warning);
    background: linear-gradient(to right, var(--warning-bg), white 20%);
}

.done-third {
    border-left: 4px solid orange;
}

.done-negative {
    border-left: 4px solid var(--danger);
    background: linear-gradient(to right, var(--danger-bg), white 20%);
}

/* Grading Buttons (Modern Circles) */
.grading-buttons {
    display: flex;
    gap: 10px;
}

.g-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #f0f0f0;
    background: #ffffff;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.5, 1.5, 0.5, 1);
    /* Bouncy */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.g-btn:active {
    transform: scale(0.9);
}

/* Active States */
.g-btn.active {
    transform: scale(1.15);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-1.active {
    background: var(--success);
}

.btn-2.active {
    background: var(--warning);
}

.btn-3.active {
    background: orange;
}

.btn-neg.active {
    background: var(--danger);
}


/* --- Advanced Slide-Out Menu --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.4);
    /* Darker dim */
    backdrop-filter: blur(4px);
    /* Blur behind */
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    z-index: 999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-overlay.show {
    display: block;
    opacity: 1;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.menu-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
}

.menu-close {
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 0.8;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-links a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    transition: background 0.2s;
}

.menu-links a:hover {
    background: #f5f6fa;
    color: var(--primary);
}

.menu-links a.logout {
    color: var(--danger);
    margin-top: 20px;
    border: 1px solid var(--danger-bg);
}

/* --- Bottom Nav (App Like) --- */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 90;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 600;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s;
}

.bottom-nav a svg,
.bottom-nav a i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.bottom-nav a.active {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
}

/* --- Forms & Modals --- */
/* --- Forms & Modals --- */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    /* High z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: none;
    padding: 32px;
    width: 90%;
    max-width: 450px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    font-weight: 700;
}

.close:hover {
    color: var(--danger);
}

.form-group label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    /* Subtle border */
    transition: all 0.2s;
    width: 100%;
    /* Ensure full width */
    padding: 12px 16px;
    /* Fat inputs */
    border-radius: 12px;
    /* Smooth corners */
    font-size: 1rem;
    color: var(--text-main);
    box-sizing: border-box;
    /* Fix padding w/ width */
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
    outline: none;
}

/* --- Date Nav --- */
.date-nav {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.current-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.green {
    background: var(--success);
    color: white;
}

/* --- Milestones --- */
.milestone-card {
    align-items: center;
}

.milestone-card .card-image {
    border-radius: 16px;
    width: 100px;
    height: 100px;
    box-shadow: var(--shadow-sm);
}

.points-badge {
    background: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Responsive tweaks */
/* --- Child Profile Header --- */
.child-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    /* Circle */
    background-color: var(--secondary);
    /* Fallback color */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(108, 92, 231, 0.2);
}

.profile-stats {
    flex: 1;
}

.xp-display {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 5px;
}

.level-display {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Points Inputs Grid --- */
.points-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.points-grid .form-group {
    margin-bottom: 0;
}

.points-grid label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}

.landing-container {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px 30px;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-header .logo {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.landing-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.auth-toggle {
    background: #f1f2f6;
    border-radius: 50px;
    padding: 5px;
    display: flex;
    margin-bottom: 25px;
    position: relative;
}

.auth-toggle button {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 40px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s;
}

.auth-toggle button.active {
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.divider {
    margin: 20px 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #eee;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.btn-google {
    background: white;
    border: 2px solid #eee;
    color: #444;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

/* --- Alerts --- */
.alert {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 118, 117, 0.2);
}

@media (max-width: 600px) {
    .main-container {
        padding: 16px;
        padding-bottom: 120px;
    }

    .bottom-nav {
        bottom: 16px;
        width: calc(100% - 32px);
    }

    .g-btn {
        width: 40px;
        height: 40px;
    }
}