/* Custom styles to complement Tailwind and define the app's aesthetic */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc; /* A light gray, almost white, for a clean look */
}
/* A standard transition class for interactive elements */
.transition-all-fast {
    transition: all 0.2s ease-in-out;
}
/* Style for the currently active navigation link in the sidebar */
.nav-link.active {
    background-color: #2563eb; /* A vibrant blue for active state */
    color: white;
}
/* Hides the scrollbar for a cleaner look in scrollable areas */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
/* Styles for the modal backdrop and transition */
.modal {
    transition: opacity 0.3s ease;
}
/* Custom animation for the timer progress bar */
@keyframes progress-bar-animation {
    from { width: 100%; }
    to { width: 0%; }
}
.progress-bar-animated {
    animation: progress-bar-animation linear;
}
/* Spinner animation */
.spinner {
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Style for the map container */
#map {
    /* Changed for mobile responsiveness */
    height: 70vh; /* Use a percentage of viewport height */
    min-height: 300px; /* Ensure a minimum height for usability */
    max-height: 900px; /* Increased for larger screens */
    border-radius: 1rem;
    z-index: 10; /* Ensures map is interactive */
}

/* Specific style for modal close buttons to ensure visibility */
.modal button[id^="close-"] {
    background-color: rgba(255, 0, 0, 0.4); /* Semi-transparent dark background */
    color: white; /* White icon */
    border-radius: 50%; /* Make it round */
    padding: 0.5rem; /* Add some padding */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Adjust line-height for better centering of icon */
    width: 2.5rem; /* Fixed width for consistent round shape */
    height: 2.5rem; /* Fixed height for consistent round shape */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    border: 2px solid transparent; /* Subtle border that can change on hover */
}

.modal button[id^="close-"]:hover {
    background-color: rgba(255, 0, 0, 0.6); /* Darker on hover */
    color: white; /* Keep white on hover */
    border-color: white; /* White border on hover */
}


/* --- Guided Breathing Exercise --- */

.breathing-exercise-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.breathing-circle-container {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-circle {
    width: 100%;
    height: 100%;
    background-color: var(--secondary-color, #3b82f6); /* Fallback color */
    border-radius: 50%;
    /* This is the key part for the animation */
    transition: transform 1s ease-in-out;
    transform: scale(0.6); /* Initial "exhaled" state */
}

.breathing-instruction {
    position: absolute;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.breathing-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.breathing-timer-inputs {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.breathing-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.breathing-input-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.breathing-input-group input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.main-view {
    display: flex;
    flex-direction: column;
}

/* Mobile-specific adjustments for forecast section */
@media (max-width: 767px) { /* Targets screens smaller than 'md' breakpoint in Tailwind */
    /* Adjust grid for "Current Conditions" to show 2 columns, wrapping if needed */
    #forecast-today-container .grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Reduced minmax for smaller phones */
        gap: 10px; /* Further reduce gap on smaller screens */
    }

    /* Force table elements to stack vertically on small screens */
    #forecast-table-container table {
        width: 100%; /* Ensure the overall table can take full width */
        display: block; /* Important for stacking */
        border-collapse: collapse; /* Remove default table borders */
    }

    #forecast-table-container thead,
    #forecast-table-container tbody,
    #forecast-table-container th,
    #forecast-table-container td,
    #forecast-table-container tr {
        display: block; /* Make all table components behave like blocks */
    }

    #forecast-table-container thead tr {
        position: absolute; /* Hide the original table header */
        top: -9999px;
        left: -9999px;
    }

    #forecast-table-container tr {
        border: 1px solid #e2e8f0; /* Add a border to each "row" block */
        margin-bottom: 10px; /* Space between stacked "rows" */
        border-radius: 8px; /* Slightly rounded corners */
        overflow: hidden; /* Ensures border-radius applies to content */
    }

    #forecast-table-container td {
        border: none; /* Remove individual cell borders */
        border-bottom: 1px solid #eee; /* Add a separator between "cells" within a stacked row */
        position: relative;
        padding-left: 50%; /* Make space for the pseudo-element label */
        text-align: left !important; /* Force left alignment for better readability */
        font-size: 0.9em; /* Slightly smaller text for stacked view */
        white-space: normal; /* Allow text to wrap naturally */
    }

    #forecast-table-container td:last-child {
        border-bottom: 0; /* No border for the last cell in a stacked row */
    }

    /* Use pseudo-elements to display column headers as labels for each cell */
    #forecast-table-container td:before {
        content: attr(data-label); /* Get content from data-label attribute */
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap; /* Keep label on one line */
        font-weight: bold;
        text-align: left;
        color: #4a5568; /* Darker text for labels */
    }
}
.direction-arrow {
    margin-left: 0.25em; /* Add a small space to the left of the arrow */
    font-weight: normal; /* Ensure the arrow itself isn't bold unless desired */
}
#auth-view {
  background-color: #f8fafc; /* The light slate background color */
  background-image: url("data:image/svg+xml,%3csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M 0 40 Q 20 20, 40 40 T 80 40' stroke='%23e2e8f0' stroke-width='2' fill='none' /%3e%3c/svg%3e");
}
/* --- Apnea Walk Performance View Styles (REVISED) --- */
#apnea-walk-performance-view {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0f172a; /* bg-slate-900 */
  z-index: 9999; 
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #f8fafc; /* bg-slate-50 */
  cursor: pointer;
  /* The 'display' property is now controlled by the '.hidden' class */
}

/* We still use the 'hidden' class from Tailwind to toggle visibility */
/* This is a fallback to ensure it works, even though Tailwind provides it. */
.hidden {
  display: none !important; /* Use !important to ensure override */
}
/* 1. On DESKTOP screens (1024px and wider), always show the nav text. */
@media (min-width: 1024px) {
  #main-sidebar .nav-link span {
    display: inline !important;
  }
}

/* 2. On MOBILE screens, show the nav text ONLY when the body has the 'mobile-menu-open' class. */
body.mobile-menu-open #main-sidebar .nav-link span {
  display: inline !important;
}