:root {
    --primary-color: #ff9eb5;
    --secondary-color: #ffbdd3;
    --accent-color: #ff6b9d;
    --emergency-color: #dc3545;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --text-color: #333;
    --light-text: #666;
    --background-color: linear-gradient(135deg, #ffeef5 0%, #ffe0f0 100%);
    --white: #ffffff;
    --border-color: #f0f0f0;
    --shadow: 0 4px 20px rgba(255, 107, 157, 0.15);
    --card-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header h1 i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.emergency-btn {
    background-color: var(--emergency-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.emergency-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.emergency-btn i {
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Pregnancy Overview Card */
.pregnancy-overview-card {
    background: linear-gradient(135deg, var(--white) 0%, #fef7fb 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: none; /* Hidden by default, shown only when authenticated */
}

.pregnancy-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.pregnancy-greeting {
    color: var(--light-text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.pregnancy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 158, 181, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 158, 181, 0.2);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--light-text);
    font-weight: 500;
}

.pregnancy-progress {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 158, 181, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--light-text);
    margin: 0;
}

/* Daily Tip */
.daily-tip {
    background: linear-gradient(135deg, #fff3e0 0%, #ffeaa7 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid #fdd835;
}

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

.tip-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e65100;
    margin: 0;
}

.tip-header h2 i {
    color: #ffc107;
    margin-right: 0.5rem;
}

.tip-date {
    font-size: 0.9rem;
    color: #ef6c00;
    font-weight: 500;
}

.tip-content h3 {
    color: #bf360c;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tip-content p {
    color: #5d4037;
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

.tag {
    background: rgba(255, 193, 7, 0.2);
    color: #ef6c00;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #ffc107;
}

/* Pregnancy Tools */
.pregnancy-tools {
    margin-bottom: 2rem;
}

.pregnancy-tools h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.2);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.tool-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.tool-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--light-text);
    margin: 0;
}

.tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    letter-spacing: 0.2px;
}

.tool-badge-available {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #66bb6a;
}

.tool-badge-beta {
    background: #fff8e1;
    color: #ef6c00;
    border: 1px solid #ffcc80;
}

.location-status {
    background: var(--white);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
}

.location-status i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Emergency Services */
.emergency-services {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.emergency-services h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
}

.services-list {
    display: grid;
    gap: 1rem;
}

.service-card {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--white);
    box-shadow: var(--card-shadow);
}

.service-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.2);
}

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

.service-card h3 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    padding-right: 1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.status-open {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.status-referenced {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

.status-closed {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.status-pilot {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.service-address {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.obstetric-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 158, 181, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 158, 181, 0.3);
}

.obstetric-status i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.obstetric-status span {
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
}

.access-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #bde0ff;
}

.access-info i {
    color: var(--info-color);
    font-size: 0.9rem;
    margin-top: 0.1rem;
}

.access-info span {
    font-size: 0.85rem;
    color: #1565c0;
    line-height: 1.3;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.service-card .distance {
    color: var(--light-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.service-card .travel-time {
    color: var(--accent-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Quick Actions */
.quick-actions {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.quick-actions h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    background: var(--white);
    border: 2px solid var(--emergency-color);
    color: var(--emergency-color);
    padding: 1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--card-shadow);
}

.quick-action-btn.emergency {
    background: linear-gradient(135deg, var(--emergency-color), #c82333);
    color: var(--white);
    border-color: var(--emergency-color);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-action-btn i {
    font-size: 1.2rem;
}

.quick-action-btn.roadmap {
    border-color: #8a8f98;
    color: #5f6670;
    background: #f6f7f9;
}

.quick-action-btn.roadmap:hover {
    background: #eceff3;
    color: #4b535e;
}

.quick-action-note {
    display: inline-block;
    font-size: 0.7rem;
    background: #e4e8ee;
    color: #4f5965;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-weight: 700;
}

.roadmap-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid #e8ebf0;
}

.roadmap-header h2 {
    margin-bottom: 0.25rem;
    color: #243447;
}

.roadmap-header p {
    color: #647084;
    margin-bottom: 1rem;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.roadmap-item {
    background: #f7f9fc;
    border: 1px solid #e5e9f1;
    border-radius: 12px;
    padding: 0.95rem;
}

.roadmap-item h3 {
    margin: 0.45rem 0 0.35rem 0;
    font-size: 1rem;
    color: #2e3d52;
}

.roadmap-item p {
    margin: 0;
    font-size: 0.88rem;
    color: #5f6f84;
}

.roadmap-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: #eef2ff;
    color: #4256a8;
    border: 1px solid #d9e1ff;
}

/* Pregnancy Info */
.pregnancy-info {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.pregnancy-info h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-card {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.info-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--light-text);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-content-wide {
    max-width: 680px;
}

.modal-content-wide .modal-body {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

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

.modal-header h2 {
    margin: 0;
}

.modal-body {
    display: block;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light-text);
}

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

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.emergency-action {
    flex: 1;
    background: var(--emergency-color);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.emergency-action:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.emergency-action i {
    margin-right: 0.5rem;
}

/* Contacts */
.contacts-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.contact-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

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

.contact-actions {
    display: flex;
    gap: 0.5rem;
}

.contact-actions button {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.contact-actions button:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form input,
form select {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

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

form button[type="submit"] {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

form button[type="submit"]:hover {
    background: #357abd;
}

.add-btn {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: #ff5252;
}

.add-btn i {
    margin-right: 0.5rem;
}

/* Ad Banner - Google AdSense */
.ad-banner {
    margin: 20px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner .adsbygoogle {
    display: block;
    width: 100%;
}

/* Premium Upgrade Banner */
.premium-banner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: var(--shadow);
    border: 2px solid #FFB74D;
}

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

.premium-content i {
    color: #FF8F00;
    font-size: 1.2rem;
}

.premium-content span {
    flex: 1;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.upgrade-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.upgrade-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1.1rem 0;
    }

    .header {
        padding: 0.9rem 0;
    }

    .header .container {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
        align-items: center;
    }

    .header h1 {
        font-size: 1.35rem;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .tool-card {
        padding: 1rem 0.85rem;
        min-height: 168px;
    }

    .tool-card h3 {
        font-size: 0.95rem;
    }

    .tool-card p {
        font-size: 0.82rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1.25rem;
    }

    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .emergency-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-action-btn {
        min-height: 72px;
        font-size: 0.88rem;
        padding: 0.75rem 0.45rem;
    }

    .roadmap-section {
        padding: 1rem;
    }

    .service-card {
        padding: 1rem;
    }

    .pregnancy-overview-card,
    .daily-tip,
    .quick-actions,
    .pregnancy-info,
    .emergency-services {
        border-radius: 14px;
        padding: 1rem;
    }

    .weight-indicators {
        grid-template-columns: 1fr;
    }
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0056b3;
        --text-color: #000;
        --light-text: #333;
        --border-color: #000;
    }
}

/* Auth Styles */
.auth-form {
    padding: 20px 0;
}

.auth-feedback {
    display: none;
    margin-bottom: 12px;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.35;
}

.auth-feedback-info,
.auth-feedback-success,
.auth-feedback-error {
    display: block;
}

.auth-feedback-info {
    border: 1px solid #bae6fd;
    background: #eff6ff;
    color: #075985;
}

.auth-feedback-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.auth-feedback-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

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

.auth-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #E8E8E8;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.full-width {
    width: 100%;
    margin: 10px 0;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #666;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E8E8E8;
    z-index: 1;
}

.auth-divider::after {
    content: 'ou';
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-google {
    background: #db4437;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-google:hover {
    background: #c23321;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-switch a {
    color: #FF6B9D;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* User Profile UI */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FF6B9D;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-info h3 {
    margin: 0;
    color: white;
    font-size: 16px;
}

.user-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.auth-required {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin: 20px 0;
}

.auth-required h2 {
    color: #FF6B9D;
    margin-bottom: 20px;
}

.auth-required p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-icon {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Service Action Buttons */
.service-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #E8E8E8;
}

.service-action-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.service-action-btn i {
    font-size: 11px;
}

.btn-call {
    background: #28a745;
    color: white;
}

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

.btn-navigate {
    background: #007bff;
    color: white;
}

.btn-navigate:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-location {
    background: #6f42c1;
    color: white;
}

.btn-location:hover {
    background: #5a32a3;
    transform: translateY(-1px);
}

.btn-copy {
    background: #6c757d;
    color: white;
}

.btn-copy:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Mobile responsive for action buttons */
@media (max-width: 768px) {
    .service-actions {
        flex-direction: column;
    }
    
    .service-action-btn {
        min-width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .service-action-btn i {
        font-size: 14px;
    }
}

.feature-panel {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
    margin-bottom: 1rem;
}

.feature-panel h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.feature-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feature-row:last-child {
    margin-bottom: 0;
}

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

.feature-empty {
    text-align: center;
    color: var(--light-text);
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
}

.feature-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feature-button {
    border: none;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.feature-button.primary {
    background: var(--accent-color);
    color: #fff;
}

.feature-button.secondary {
    background: #edf2f7;
    color: #243447;
}

.feature-button.danger {
    background: #ffe8e8;
    color: #c62828;
}

.feature-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.feature-form {
    display: grid;
    gap: 0.75rem;
}

.feature-form input,
.feature-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font: inherit;
}

.feature-form textarea {
    resize: vertical;
    min-height: 80px;
}

.feature-divider {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.feature-highlight {
    font-weight: 700;
    color: var(--accent-color);
}

.weight-indicators {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.weight-indicator {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    background: #fafbff;
}

.weight-indicator-label {
    display: block;
    font-size: 0.78rem;
    color: var(--light-text);
    margin-bottom: 0.2rem;
}

.weight-indicator-value {
    font-size: 0.98rem;
    color: #2a3448;
}

.weight-chart-wrap {
    width: 100%;
}

.weight-chart-svg {
    width: 100%;
    height: auto;
    max-height: 190px;
    display: block;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid #e8eef8;
}

.weight-chart-axis {
    stroke: #d6dce9;
    stroke-width: 1.2;
}

.weight-chart-line {
    fill: none;
    stroke: #ff6b9d;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.weight-chart-svg circle {
    fill: #ff6b9d;
}

.weight-chart-meta {
    margin-top: 0.35rem;
    display: flex;
    justify-content: space-between;
    color: #6f7890;
    font-size: 0.78rem;
}

/* Design refresh - mobile first */
:root {
    --primary-color: #0f766e;
    --secondary-color: #dff5f2;
    --accent-color: #f97316;
    --emergency-color: #b91c1c;
    --success-color: #15803d;
    --info-color: #0369a1;
    --warning-color: #ca8a04;
    --text-color: #0f172a;
    --light-text: #475569;
    --border-color: #dce5ed;
    --white: #ffffff;
    --background-color: radial-gradient(circle at 10% 10%, #ecfeff 0%, #f8fafc 45%, #eef2ff 100%);
    --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    --card-shadow: 0 12px 36px rgba(15, 23, 42, 0.1);
}

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    color: var(--text-color);
    background: var(--background-color);
    position: relative;
}

body::before,
body::after {
    content: '';
    position: fixed;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    z-index: -1;
    pointer-events: none;
    filter: blur(10px);
}

body::before {
    top: -90px;
    right: -80px;
    background: rgba(249, 115, 22, 0.19);
}

body::after {
    bottom: -100px;
    left: -80px;
    background: rgba(15, 118, 110, 0.2);
}

.container {
    max-width: 1080px;
    padding: 0 14px;
}

.header {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 55%, #0f766e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.header h1 {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.header h1 i {
    color: #fdba74;
}

.main-content {
    padding: 1rem 0 1.4rem;
}

.main-content section,
.location-status,
.pregnancy-overview-card {
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--card-shadow);
}

.pregnancy-overview-card {
    background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
    padding: 1.25rem;
}

.pregnancy-header h2 {
    color: #0f172a;
    font-size: 1.32rem;
}

.pregnancy-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.stat-item {
    background: linear-gradient(140deg, #f8fafc 0%, #e2f3f1 100%);
    border: 1px solid #cde9e4;
    border-radius: 14px;
    padding: 0.7rem 0.45rem;
}

.stat-number {
    font-size: 1.2rem;
    color: #0f766e;
}

.progress-bar {
    background: #dbe7ee;
    height: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #0f766e 0%, #f97316 100%);
}

.location-status {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(8px);
    margin-bottom: 1.1rem;
}

.location-status i {
    color: #0f766e;
}

.emergency-services,
.quick-actions,
.roadmap-section,
.pregnancy-info,
.daily-tip {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--card-shadow);
    padding: 1.05rem;
    margin-bottom: 1.1rem;
}

.emergency-services h2,
.quick-actions h2,
.pregnancy-tools h2,
.pregnancy-info h2,
.roadmap-header h2 {
    color: #0f172a;
    font-size: 1.14rem;
    margin-bottom: 0.9rem;
}

.daily-tip {
    background: linear-gradient(165deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}

.tip-header h2 {
    color: #9a3412;
}

.tag {
    border: 1px solid #fdba74;
    background: #ffedd5;
    color: #9a3412;
}

.services-list {
    gap: 0.75rem;
}

.service-card {
    border-radius: 14px;
    padding: 1rem;
    border-color: #d5e1ec;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.service-card h3 {
    font-size: 1rem;
}

.service-footer {
    padding-top: 0.65rem;
}

.tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.1rem;
}

.tool-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #d7e2ec;
    border-radius: 16px;
    padding: 1rem 0.7rem;
    min-height: 156px;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: #0f766e;
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.16);
}

.tool-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, #0f766e 0%, #0ea5e9 100%);
}

.tool-card h3 {
    font-size: 0.95rem;
    line-height: 1.25;
}

.tool-card p {
    font-size: 0.78rem;
    color: #64748b;
}

.tool-badge {
    top: 10px;
    right: 10px;
}

.actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.quick-action-btn {
    min-height: 86px;
    border-radius: 14px;
    padding: 0.78rem 0.55rem;
    font-size: 0.88rem;
    box-shadow: none;
    border-color: #d3dbe5;
    color: #1e293b;
}

.quick-action-btn:hover {
    transform: translateY(-1px);
}

.quick-action-btn.emergency {
    border-color: #991b1b;
    background: linear-gradient(140deg, #b91c1c 0%, #dc2626 100%);
    color: #fff;
}

.quick-action-btn.roadmap {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412;
}

.quick-action-note {
    background: #fed7aa;
    color: #9a3412;
}

.roadmap-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.roadmap-item {
    border-radius: 12px;
    border-color: #dde6ef;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.roadmap-tag {
    background: #ecfeff;
    color: #0f766e;
    border-color: #99f6e4;
}

.info-cards {
    grid-template-columns: 1fr;
    gap: 0.7rem;
}

.info-card {
    border-radius: 14px;
    border: 1px solid #dbe7ef;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    text-align: left;
}

.info-card i {
    color: #0f766e;
    margin-bottom: 0.45rem;
}

.info-card h3 {
    color: #0f172a;
}

.info-card p {
    color: #475569;
}

.modal {
    background-color: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(3px);
}

.modal-content {
    border-radius: 18px;
    border: 1px solid #dce7ef;
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.24);
    padding: 1.1rem;
    margin: 2.8rem auto 0;
}

.close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #e2e8f0;
    text-align: center;
    line-height: 34px;
    top: 12px;
    right: 12px;
}

.feature-panel {
    border-radius: 12px;
    border: 1px solid #dce6ef;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 0.88rem;
}

.feature-button.primary {
    background: #0f766e;
}

.feature-button.secondary {
    background: #e2e8f0;
}

.feature-button.danger {
    background: #fee2e2;
}

form input,
form select,
.feature-form input,
.feature-form textarea,
.auth-form input {
    border-radius: 10px;
    border: 1px solid #ced7e1;
    background: #fff;
}

form input:focus,
form select:focus,
.feature-form input:focus,
.feature-form textarea:focus,
.auth-form input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.btn-primary,
.add-btn,
form button[type="submit"] {
    background: linear-gradient(140deg, #0f766e 0%, #0ea5e9 100%);
}

.btn-secondary {
    background: #475569;
}

.btn-icon {
    color: rgba(255, 255, 255, 0.92);
}

.user-profile {
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.28);
}

.auth-required {
    background: linear-gradient(150deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dce6ef;
    border-radius: 16px;
    margin: 0;
}

.auth-required h2 {
    color: #0f172a;
}

.auth-switch a {
    color: #0f766e;
}

.ad-banner {
    margin: 10px 0 0;
    border-radius: 14px;
    border: 1px solid #d7e2eb;
    background: rgba(255, 255, 255, 0.72);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.78rem 1rem;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(140deg, #0f766e 0%, #0ea5e9 100%);
    color: #fff;
    border-color: #0f8d9d;
    box-shadow: 0 8px 20px rgba(14, 116, 144, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 10px 24px rgba(14, 116, 144, 0.28);
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #d5dee8;
}

.auth-required .btn {
    width: 100%;
}

.auth-required .btn + .btn {
    margin-top: 0.65rem;
}

.toast-container {
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    gap: 0.55rem;
    width: min(92vw, 360px);
    z-index: 2200;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
    border-radius: 12px;
    padding: 0.62rem 0.7rem;
    border: 1px solid transparent;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.2);
    animation: toastIn 0.16s ease-out;
}

.toast-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #14532d;
}

.toast-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #7f1d1d;
}

.toast-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #78350f;
}

.toast-info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.toast-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
    padding: 0.1rem;
}

.toast-close:hover {
    opacity: 1;
}

.toast-hide {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.diary-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.diary-stat {
    border: 1px solid #d7e2ec;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
}

.diary-stat span {
    display: block;
    font-size: 0.76rem;
    color: #64748b;
}

.diary-stat strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.02rem;
    color: #0f172a;
}

.diary-timeline {
    display: grid;
    gap: 0.7rem;
}

.diary-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid #dce7ef;
    border-radius: 12px;
    padding: 0.62rem;
    background: #fff;
}

.diary-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: #fff;
    flex-shrink: 0;
}

.diary-item-icon-consultation {
    background: #0f766e;
}

.diary-item-icon-weight {
    background: #0369a1;
}

.diary-item-icon-contraction {
    background: #b91c1c;
}

.diary-item-icon-kicks {
    background: #7c3aed;
}

.diary-item-body {
    min-width: 0;
    flex: 1;
}

.diary-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
}

.diary-item-head strong {
    font-size: 0.9rem;
    color: #0f172a;
}

.diary-item-date {
    font-size: 0.76rem;
    color: #64748b;
    white-space: nowrap;
}

.diary-item-detail {
    margin: 0.22rem 0 0.25rem;
    font-size: 0.84rem;
    color: #1f2937;
}

.diary-item-extra {
    margin: 0 0 0.28rem;
    font-size: 0.78rem;
    color: #475569;
}

.diary-chip {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.68rem;
    padding: 0.12rem 0.5rem;
    border: 1px solid transparent;
    font-weight: 700;
}

.diary-chip-consultation {
    background: #ecfeff;
    border-color: #99f6e4;
    color: #0f766e;
}

.diary-chip-weight {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.diary-chip-contraction {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.diary-chip-kicks {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
}

.diary-roadmap-grid {
    display: grid;
    gap: 0.55rem;
}

.diary-roadmap-item {
    border: 1px solid #dce7ef;
    border-radius: 10px;
    padding: 0.62rem 0.7rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.diary-roadmap-item p {
    margin: 0.35rem 0 0;
    color: #475569;
    font-size: 0.84rem;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 420px) {
    .header .container {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .emergency-btn {
        width: 100%;
        border-radius: 14px;
        padding: 0.72rem 1rem;
    }

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

    .tool-card {
        min-height: 146px;
        padding: 0.88rem 0.6rem;
    }

    .quick-action-btn {
        min-height: 80px;
    }
}

@media (min-width: 769px) {
    .container {
        padding: 0 24px;
    }

    .main-content {
        padding: 1.6rem 0 2rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .actions-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .roadmap-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .info-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .emergency-services,
    .quick-actions,
    .roadmap-section,
    .pregnancy-info,
    .daily-tip,
    .pregnancy-overview-card {
        padding: 1.35rem;
    }

    .diary-stats-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
