/* Reset default browser margins */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Base Body Styling with Faint Logo Placeholder */
body {
    /* This applies a 92% opaque pink layer directly over the logo */
    background: linear-gradient(rgba(255, 228, 233, 0.92), rgba(255, 228, 233, 0.92)),
                url('../../public/assets/page_logo.png') center/50% no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The Auth Container (replaces the circle) */
.auth-container {
  width: 320px;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Text Styling inside the container */
.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; /* Adds space between Register and Login */
  margin-bottom: 30px; 
}

.auth-links h1 {
  font-size: 26px;
  color: #000080; /* Navy Blue */
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.auth-links h1:hover {
  transform: scale(1.05);
  color: #3333b3; /* Slightly lighter blue on hover */
}

/* Form Container (Hidden by default) */
.form-container {
  display: none; /* We will use JS to show this */
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 30px;
}

/* Input Fields */
.form-container input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #b89b5e; /* Matching the gold ring */
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  color: #000080;
  outline: none;
}

/* Submit Buttons */
.form-container button {
  width: 100%;
  padding: 10px;
  background-color: #4caf50; /* PinkGreen */
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.form-container button:hover {
  background-color: #388e3c;
}

/* Back Button (To return to the main Register/Login choice) */
.back-btn {
  margin-top: 15px;
  font-size: 12px;
  color: #000080;
  cursor: pointer;
  text-decoration: underline;
}

/* =========================================
   DASHBOARD / LANDING PAGE STYLES
   ========================================= */

.dashboard-body {
  /* Override the flex centering from the login page so the nav stays at the bottom */
  display: block; 
  padding-bottom: 70px; /* Space for the bottom nav */
}

/* Top Header (Logo & Profile) */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
}

.dash-logo {
  font-weight: bold;
  color: #000080;
}

.dash-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #000080;
}

.dash-profile .avatar {
  width: 40px;
  height: 40px;
  border: 2px solid #b89b5e;
  border-radius: 50%;
  margin-bottom: 5px;
}

/* The 28-Day Tracker Wheel & Numbers Wrapper */
.tracker-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 50px 0; /* A bit more margin to fit the numbers */
}

/* The invisible box that holds both the wheel and the numbers */
.tracker-wrapper {
  position: relative;
  width: 320px; 
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tracker-wheel {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  position: absolute; /* Keeps it perfectly centered inside the wrapper */
  z-index: 2;
}

/* The individual day numbers */
.day-number {
  position: absolute;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  font-size: 13px;
  font-weight: bold;
  color: #000080; /* Navy blue */
  z-index: 1;
}

/* The hollow center of the wheel */
.tracker-inner {
  width: 160px; /* Slightly smaller to match the new wheel size */
  height: 160px;
  background-color: #ffe4e9; /* Matches the pink body */
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #000080;
}

/* =========================================
   FLOATING AI & CHAT BUTTONS
   ========================================= */
.action-buttons {
    position: fixed;
    right: 15px;       /* Keeps it pinned to the right side */
    bottom: 90px;      /* Hovers right above your bottom navigation */
    display: flex;
    flex-direction: column; /* Stacks them vertically */
    gap: 10px;
    z-index: 999;      /* Ensures they always float on top of everything */
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); /* Gives a nice 3D pop without borders */
}

.action-btn:hover {
    transform: scale(1.1); /* Slight bounce when tapped */
}

.action-btn .icon-circle {
    font-size: 38px; /* Makes the emoji/icon large and clear */
    margin-bottom: 2px;
    /* Removed the border, width, height, and border-radius! */
}

.action-btn span {
    background-color: rgba(255, 255, 255, 0.9); /* Small pill background for readability */
    color: #000080;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  display: flex;
  justify-content: space-around;
  padding: 15px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: #666;
  text-decoration: none;
}

.nav-item.active {
  color: #4caf50; /* PinkGreen for active tab */
  font-weight: bold;
}

/* =========================================
   AI MASCOT CHAT POPUP
   ========================================= */
.ai-chat-popup {
    display: none; /* Hidden until the user clicks the button */
    position: fixed;
    bottom: 85px; /* Sits right above your bottom nav */
    right: 20px;
    width: 320px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    border: 2px solid #b89b5e; /* Gold border to match your brand */
}

/* The Mascot Header */
.chat-header {
    background-color: #ffe4e9; /* Brand Pink */
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #b89b5e;
}

.mascot-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* The visual Robot Mascot */
.mascot-avatar {
    width: 40px;
    height: 40px;
    background-color: #000080; /* Navy Blue */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.chat-close {
    cursor: pointer;
    font-weight: bold;
    color: #ff0000;
    font-size: 16px;
}

/* The Chat History Area */
.chat-body {
    height: 300px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #fafafa;
}

/* Chat Bubbles */
.chat-message {
    max-width: 80%;
    padding: 12px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.4;
}

.msg-ai {
    background-color: #e0f7fa; /* Light medical blue */
    color: #006064;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.msg-user {
    background-color: #4caf50; /* PinkGreen */
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* The Typing Area */
.chat-input-area {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #ddd;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #b89b5e;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
    color: #000080;
}

.chat-input-area button {
    background-color: #000080;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.chat-input-area button:hover {
    background-color: #3333b3;
}

/* =========================================
   ANIMATIONS
   ========================================= */

/* The Breathing / Pulsing Effects for the center wheel */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(255, 204, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

/* Classes we will trigger with JavaScript */
.anim-pulse-red { animation: pulse-red 2s infinite; }
.anim-pulse-yellow { animation: pulse-yellow 2s infinite; }
.anim-pulse-green { animation: pulse-green 2s infinite; }
.anim-pulse-blue { animation: pulse-blue 2s infinite; }

/* =========================================
   BUBBLING ICONS 
   ========================================= */
@keyframes bubble-up {
    0% { 
        transform: translateY(15px) scale(0.5); 
        opacity: 0; 
    }
    20% { 
        transform: translateY(5px) scale(1.1); 
        opacity: 1; 
    }
    80% { 
        transform: translateY(-5px) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(-15px) scale(0.5); 
        opacity: 0; 
    }
}

.phase-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
}

.phase-icon-bubble {
    opacity: 0; /* Stays hidden until its random delay triggers */
    animation-name: bubble-up;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); 
}

/* =========================================
   NEW TIMELINE BAR (MATCHING SCREENSHOTS)
   ========================================= */
.timeline-container {
    width: 100%;
    padding: 0 40px;
    margin-top: 40px; /* Space for the bubble to stick up */
    margin-bottom: 30px;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #000080;
    margin-bottom: 8px;
    font-weight: bold;
}

/* The gradient track itself */
.timeline-bar {
    width: 100%;
    height: 12px;
    border-radius: 10px;
    position: relative;
    background-color: #ddd; /* Fallback before JS applies the gradient */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); 
}

/* The sliding indicator wrapper */
.timeline-indicator {
    position: absolute;
    top: -30px; /* Sticks out above the bar */
    left: 0%; /* JS will animate this */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 1s ease-out;
    transform: translateX(-50%); /* Centers it precisely over its day */
    z-index: 5;
}

/* The Pill Bubble */
.timeline-indicator-bubble {
    background-color: white;
    border: 2px solid #000080;
    border-radius: 15px;
    position: absolute;
    bottom: -70px;
    padding: 3px 10px;
    color: #000080;
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
    z-index: 2;
}

/* The line pointing down */
.timeline-indicator-line {
    width: 2px;
    height: 35px; /* Extends down across the gradient track */
    background-color: #000080;
    position: absolute;
    top: 15px;
    z-index: 1;
}

/* =========================================
   NEW UPGRADES: CALENDAR, LEGENDS, ALERTS
   ========================================= */

/* Faint text for the old month in a crossover */
.faint-date {
    opacity: 0.3;
}

/* The Color Key / Legend Area */
.color-key-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 0 20px;
    flex-wrap: wrap;
}

.color-key-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #000080;
    font-weight: bold;
}

.key-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Dedicated Fertility & Pregnancy Prediction Area */
.fertility-card {
    background-color: white;
    margin: 20px 30px;
    padding: 15px;
    border-radius: 15px;
    border-left: 5px solid #4caf50;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.fertility-card h4 {
    color: #4caf50;
    margin-bottom: 5px;
    font-size: 14px;
}

.fertility-card p {
    font-size: 12px;
    color: #666;
}

/* Pop-up Alert Modal (For "Still Bleeding?" checks) */
.alert-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.alert-modal {
    background: white;
    width: 80%;
    max-width: 320px;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.alert-modal h3 { color: #ff0000; margin-bottom: 10px; }
.alert-modal p { font-size: 13px; color: #333; margin-bottom: 20px; }
.modal-btn-group { display: flex; gap: 10px; justify-content: center; }
.modal-btn { padding: 10px 20px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; }
.btn-yes { background-color: #4caf50; color: white; }
.btn-no { background-color: #ff0000; color: white; }

/* =========================================
   PRINT & PDF EXTRACTION STYLES
   ========================================= */
@media print {
    body {
        background: white; /* Removes the pink gradient for clean printing */
        padding-bottom: 0;
    }
    
    /* Hide buttons and navigation bars */
    .no-print, .bottom-nav, .action-buttons, .ai-chat-popup {
        display: none !important;
    }

    /* Show the hidden medical header */
    .print-only {
        display: block !important;
    }

    /* Remove shadows to save printer ink / look clean on PDF */
    .history-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid; /* Prevents a card from being cut in half across two pages */
    }
}

/* =========================================
   SETTINGS MENU & PROFILE MODAL CSS
   ========================================= */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #000080;
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
}
.settings-btn:hover { color: #3498db; }

.settings-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: 30px;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #eee;
}

.settings-menu-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #f9f9f9;
    transition: 0.2s;
}

.settings-menu-content a:hover { background-color: #f0f8ff; color: #000080; }
.settings-menu-content a.danger-text { color: #ff0000; }
.settings-menu-content a.danger-text:hover { background-color: #ffe6e6; }
.show-settings { display: block; }

/* Profile Container Updates */
.dash-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}
.dash-profile .avatar {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000080;
    font-size: 20px;
    transition: 0.2s;
    overflow: hidden;
}
.dash-profile .avatar:hover { transform: scale(1.05); border-color: #3498db; }
.dash-profile .avatar img { width: 100%; height: 100%; object-fit: cover; }
.update-profile-link { font-size: 10px; color: #b89b5e; text-decoration: none; font-weight: bold; margin-top: 2px; transition: 0.2s;}
.update-profile-link:hover { color: #3498db; text-decoration: underline; }