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

:root {
    /* Typography Scale */
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-md: 1.125rem;
    /* 18px */
    --font-size-lg: 1.25rem;
    /* 20px */
    --font-size-xl: 1.5rem;
    /* 24px */
    --font-size-2xl: 1.75rem;
    /* 28px */
    --font-size-3xl: 2rem;
    /* 32px */

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    color: #1a1a1a;
    line-height: 1.6;
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#logout-btn {
    background-color: #d32f2f;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all 0.2s;
    min-width: 70px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#logout-btn:active {
    background-color: #b71c1c;
    transform: scale(0.95);
}

/* Ensure logout button stays compact on all screens */
#logout-btn {
    width: auto !important;
    min-width: 44px !important;
    padding: 0.5rem !important;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem;
    padding-top: 5rem;
    /* Account for fixed header */
    padding-bottom: 5rem;
    /* Account for fixed footer */
    width: 100%;
    max-width: 100%;
}

/* Auth Section */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Dashboard */
.dashboard {
    margin-bottom: 2rem;
    width: 100%;
}

.children-list {
    margin-top: 1rem;
    width: 100%;
}

.children-list h3 {
    margin-bottom: 1rem;
    color: #2e7d32;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
}

/* Overview Cards */
.overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #ffffff;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(27, 94, 32, 0.3);
    height: 70px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 10px;
}

.nav-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 0;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: var(--font-size-xs);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    position: relative;
    text-align: center;
    margin: 0 2px;
    gap: 4px;
    /* Add consistent spacing between icon and text */
}

.nav-btn:active {
    transform: scale(0.92);
}

.nav-btn.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-btn:not([style*="display: none"]) {
    display: flex;
}

.nav-icon {
    font-size: 1.4rem;
    transition: all 0.3s ease;
    display: block;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: var(--font-weight-medium);
    transition: all 0.3s ease;
    display: block;
    line-height: 1.2;
}

.nav-btn.active .nav-icon {
    transform: scale(1.1);
}

.nav-btn.active .nav-label {
    font-weight: var(--font-weight-semibold);
}

/* Add badge indicator for active items */
.nav-btn.active::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 20%;
    width: 6px;
    height: 6px;
    background-color: #ffeb3b;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 235, 59, 0.6);
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
    header h1 {
        font-size: var(--font-size-md);
    }

    .logo {
        gap: 0.5rem;
    }

    .app-logo {
        width: 35px;
        height: 35px;
    }

    main {
        padding: 0.75rem;
        padding-top: 4.5rem;
        padding-bottom: 5rem;
    }

    .auth-container {
        gap: 1.25rem;
        margin-top: 1.5rem;
    }

    .dashboard h2 {
        font-size: var(--font-size-lg);
    }

    .children-list h3 {
        font-size: var(--font-size-base);
    }

    .nav-label {
        font-size: 0.65rem;
    }

    .nav-icon {
        font-size: 1.2rem;
    }
}

/* Touch-friendly interactions */
button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Prevent zoom on input focus */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
    font-size: 16px;
}

/* Ensure proper viewport handling */
html {
    height: 100%;
    overflow-x: hidden;
}

body {
    position: relative;
    height: 100%;
    overflow-x: hidden;
}