/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #F6DFEB 0%, #E4C1F9 100%);
    color: #333;
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Color Palette Variables */
:root {
    --primary-pink: #F6DFEB;
    --secondary-purple: #E4C1F9;
    --accent-green: #D0F4DE;
    --accent-yellow: #FCF6BD;
    --accent-coral: #FFB7C5;
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

/* Header */
.app-header {
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.profile-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-purple);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.profile-btn:hover {
    background: var(--primary-pink);
}

/* Main Content */
.main-content {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Welcome Card */
.welcome-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    text-align: center;
}

.welcome-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.welcome-card p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-card {
    background: var(--white);
    border: none;
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-dark);
}

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

.action-card i {
    font-size: 2rem;
    color: var(--secondary-purple);
}

.action-card span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Children List */
.children-list {
    display: grid;
    gap: 1rem;
}

.child-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.child-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.child-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.child-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.child-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-pink);
    border-radius: var(--border-radius);
    background: var(--white);
    font-size: 1rem;
    min-width: 200px;
}

.add-btn {
    background: var(--secondary-purple);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.add-btn:hover {
    background: #d1a7f0;
    transform: scale(1.1);
}

/* Age Groups */
.age-groups {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.age-group-btn {
    background: var(--white);
    border: 2px solid var(--primary-pink);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
}

.age-group-btn.active {
    background: var(--secondary-purple);
    color: var(--white);
    border-color: var(--secondary-purple);
}

.age-group-btn:hover {
    background: var(--primary-pink);
}

/* Milestones List */
.milestones-list {
    display: grid;
    gap: 0.75rem;
}

.milestone-item {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--primary-pink);
}

.milestone-item:hover {
    background: #fafafa;
}

.milestone-item.completed {
    border-left-color: var(--accent-green);
    background: #f8fff9;
}

.milestone-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-pink);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.milestone-item.completed .milestone-checkbox {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--white);
}

.milestone-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.milestone-age {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--primary-pink);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

/* Growth Form */
.growth-form {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--primary-pink);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-purple);
}

/* Buttons */
.primary-btn {
    background: var(--secondary-purple);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.primary-btn:hover {
    background: #d1a7f0;
    transform: translateY(-1px);
}

.secondary-btn {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--primary-pink);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: var(--primary-pink);
}

/* Growth Chart */
.growth-chart-container {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    text-align: center;
}

#growthChart {
    max-width: 100%;
    height: auto;
}

/* Growth Records */
.growth-records {
    display: grid;
    gap: 0.75rem;
}

.growth-record {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
}

.record-date {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.record-values {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.record-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.delete-record {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.delete-record:hover {
    background: #ffe0e0;
}

/* Activities */
.activities-list {
    display: grid;
    gap: 1rem;
}

.activity-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-yellow);
}

.activity-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.activity-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.activity-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.activity-tag {
    background: var(--accent-yellow);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Reminders */
.reminders-list {
    display: grid;
    gap: 1rem;
}

.reminder-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    border-left: 4px solid var(--accent-coral);
}

.reminder-card.overdue {
    border-left-color: #ff6b6b;
    background: #fff5f5;
}

.reminder-card.today {
    border-left-color: #ffa500;
    background: #fffaf0;
}

.reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.reminder-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.reminder-type {
    background: var(--accent-coral);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.reminder-info {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.reminder-child,
.reminder-datetime {
    font-size: 0.9rem;
    color: var(--text-light);
}

.reminder-notes {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-style: italic;
}

.reminder-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.complete-reminder,
.delete-reminder {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.complete-reminder {
    color: var(--accent-green);
}

.complete-reminder:hover {
    background: #f0fff4;
}

.delete-reminder {
    color: #ff6b6b;
}

.delete-reminder:hover {
    background: #ffe0e0;
}

/* FAQ Section */
.faq-section {
    margin: 2rem 0;
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.faq-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.faq-container {
    display: grid;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--primary-pink);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: var(--white);
    border: none;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--primary-pink);
}

.faq-question[aria-expanded="true"] {
    background: var(--primary-pink);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    background: #fafafa;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer:not([hidden]) {
    padding: 1rem;
    max-height: 200px;
}

.faq-answer p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.5;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    transition: var(--transition);
    padding: 0.25rem;
    border-radius: 8px;
    min-width: 60px;
}

.nav-item.active {
    color: var(--secondary-purple);
}

.nav-item:hover {
    color: var(--secondary-purple);
    background: var(--primary-pink);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--primary-pink);
}

.modal form {
    padding: 0 1.5rem 1.5rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    background: var(--white);
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (min-width: 768px) {
    .main-content {
        padding: 2rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .children-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .modal-actions {
        grid-template-columns: auto auto;
        justify-content: flex-end;
    }
    
    .primary-btn,
    .secondary-btn {
        width: auto;
        min-width: 120px;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        position: relative;
        box-shadow: none;
        background: transparent;
        justify-content: center;
        gap: 2rem;
        padding: 1rem 0;
    }
    
    .nav-item {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        background: var(--white);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        min-width: auto;
    }
    
    .nav-item span {
        font-size: 1rem;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-pink);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.content-section.active {
    animation: slideInUp 0.3s ease;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus,
.nav-item:focus {
    outline: 2px solid var(--secondary-purple);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 10px rgba(0,0,0,0.3);
        --shadow-hover: 0 4px 20px rgba(0,0,0,0.4);
    }
}
