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

:root {
    --primary-color: #1a5a96;
    --primary-dark: #0d3d66;
    --secondary-color: #e8f4fd;
    --success-color: #28a745;
    --success-light: #d4edda;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-brand {
    text-align: left;
}

.brand-link {
    color: white;
    text-decoration: none;
}

.brand-link h1 {
    font-size: 2rem;
    margin-bottom: 0;
}

.brand-link .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

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

.user-name {
    opacity: 0.9;
    font-size: 0.95rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.btn-primary {
    background: white;
    color: var(--primary-color);
}

.nav-link.btn-primary:hover {
    background: #f0f0f0;
}

.logout-form {
    display: inline;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Main Content */
main {
    padding: 40px 20px;
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-light);
    padding: 5px;
    line-height: 1;
}

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

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: var(--success-light);
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Feature Icon (legacy) */
.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

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

/* Schedule Preview */
.schedule-preview {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.schedule-preview h2 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    color: var(--primary-dark);
}

/* Children Grid */
.children-grid {
    display: grid;
    gap: 20px;
}

.child-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

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

.child-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.child-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.child-info {
    flex: 1;
}

.child-info h3 {
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.child-age {
    color: var(--primary-color);
    font-weight: 500;
}

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

.child-arrow {
    font-size: 1.5rem;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
}

/* Form Styles */
.form-page {
    display: flex;
    justify-content: center;
}

.form-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
}

.form-header {
    margin-bottom: 30px;
}

.form-header h2 {
    color: var(--primary-dark);
    margin-top: 15px;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Danger Zone */
.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 30px 0;
}

.danger-zone {
    padding: 20px;
    border: 2px solid var(--danger-color);
    border-radius: 8px;
    background: #fff5f5;
}

.danger-zone h3 {
    color: var(--danger-color);
    margin-bottom: 10px;
}

.danger-zone p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Profile Page */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.profile-info .back-link {
    display: block;
    margin-bottom: 15px;
}

.profile-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-title h2 {
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Documents Section */
.documents-section,
.vaccinations-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

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

.section-header h3 {
    color: var(--primary-dark);
}

.upload-form {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-form form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-form small {
    display: block;
    margin-top: 10px;
    color: var(--text-light);
    width: 100%;
}

.file-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 12px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-light);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.document-card {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.document-preview {
    display: block;
    height: 150px;
    overflow: hidden;
    background: var(--border-color);
}

.document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-preview.pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
}

.pdf-icon {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.document-info {
    padding: 10px;
}

.document-name {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.document-card .delete-form {
    position: absolute;
    top: 5px;
    right: 5px;
}

.no-documents {
    color: var(--text-light);
    font-style: italic;
}

/* Filters */
.filters {
    margin-bottom: 30px;
}

.filters h2,
.filters h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--secondary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Tracker Info */
.tracker-info {
    background: var(--secondary-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

/* Schedule Cards */
.age-group {
    margin-bottom: 40px;
}

.age-group-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.age-group-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.age-group-title h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.age-group-title p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.timing-section {
    margin-bottom: 25px;
}

.timing-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timing-label::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.vaccines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.vaccine-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

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

.vaccine-card.completed {
    background: var(--success-light);
    border-color: var(--success-color);
}

.vaccine-card.completed::after {
    content: '\2713';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.vaccine-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    padding-right: 35px;
}

.vaccine-details {
    color: var(--text-light);
    font-size: 0.9rem;
}

.vaccine-diseases {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.disease-tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 3px 3px 3px 0;
}

.vaccine-card.completed .disease-tag {
    background: rgba(40, 167, 69, 0.2);
    color: #1e7e34;
}

.vaccine-date {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-light);
}

.vaccine-date input {
    margin-left: 10px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

.vaccine-notes {
    margin-top: 8px;
}

.vaccine-notes input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Progress Section */
.progress-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-top: 40px;
}

.progress-section h2,
.progress-section h4 {
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #34ce57);
    border-radius: 15px;
    transition: width 0.5s ease;
    width: 0%;
}

#progress-text {
    color: var(--text-light);
    margin-bottom: 20px;
}

.reset-btn {
    padding: 10px 25px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.reset-btn:hover {
    background: #c82333;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h2 {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.error-page p {
    color: var(--text-light);
    margin-bottom: 25px;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: auto;
}

footer a {
    color: #8dc8ff;
}

footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.age-group {
    animation: fadeIn 0.3s ease;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

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

    .brand-link h1 {
        font-size: 1.8rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .vaccines-grid {
        grid-template-columns: 1fr;
    }

    .age-group-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-header {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-title {
        flex-direction: column;
        text-align: center;
    }

    .profile-actions {
        justify-content: center;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .steps {
        gap: 20px;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin-bottom: 15px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* How It Works Section */
.how-it-works {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.how-it-works h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 30px;
}

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

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.step-content p {
    color: var(--text-light);
}

/* Features Section (Landing Page) */
.features {
    margin-bottom: 40px;
}

.features h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

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

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 50px 40px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 40px;
}

.cta-section h2 {
    margin-bottom: 15px;
}

.cta-section p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.cta-section .btn {
    background: white;
    color: var(--primary-color);
}

.cta-section .btn:hover {
    background: #f0f0f0;
}

/* Info Section */
.info-section {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.info-section h2 {
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.info-section p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.disease-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.disease-list li {
    padding: 10px 15px;
    background: var(--secondary-color);
    border-radius: 5px;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.disease-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 10px;
}

.info-note {
    font-style: italic;
    padding: 15px;
    background: #fff3cd;
    border-radius: 5px;
    border-left: 4px solid var(--warning-color);
    margin-top: 20px;
}
