/* ==========================================================================
   Decompression Model Visualizer - Styles
   ========================================================================== */

/* CSS Variables */
:root {
    --primary-color: #2980b9;
    --primary-dark: #1a5276;
    --secondary-color: #27ae60;
    --warning-color: #e74c3c;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #dce1e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Scroll offset for anchor links (accounts for sticky nav) */
section[id],
.concept-card[id] {
    scroll-margin-top: 100px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.main-nav {
    background: var(--primary-dark);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.nav-logo {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 1rem 0;
}

.nav-logo:hover {
    opacity: 0.9;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 1rem 1.25rem;
    display: block;
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-links a.active {
    color: white;
    border-bottom-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    cursor: pointer;
}

.nav-dropdown > a::after {
    content: ' ▾';
    font-size: 0.7em;
    opacity: 0.7;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary-dark);
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 6px 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu li {
    margin: 0;
}

.nav-dropdown-menu a {
    padding: 0.75rem 1.25rem;
    border-bottom: none;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-dropdown-menu a.active {
    border-bottom: none;
    background: rgba(255, 255, 255, 0.1);
}

.nav-wip-badge {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Hamburger Menu Button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.nav-hamburger span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.nav-hamburger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.nav-hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ==========================================================================
   Landing Page - Hero
   ========================================================================== */

.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Compact hero for tool pages */
.hero.hero-compact {
    padding: 1.5rem 2rem;
}

.hero.hero-compact h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.hero.hero-compact .hero-subtitle {
    font-size: 1rem;
}

.language-notice {
    font-size: 0.95rem;
    opacity: 0.85;
    max-width: 650px;
    margin: 1.5rem auto 0;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Landing Page - Main Content
   ========================================================================== */

.landing-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Featured Quote Section */
.quote-section {
    margin-bottom: 2.5rem;
    text-align: center;
}

.featured-quote {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.5rem 2rem;
    margin: 0 0 1rem 0;
    font-style: italic;
    position: relative;
}

.featured-quote::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    top: -0.5rem;
    left: 0.5rem;
    font-family: Georgia, serif;
    line-height: 1;
}

.featured-quote p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    position: relative;
    z-index: 1;
}

.featured-quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: normal;
}

.quote-context {
    font-size: 1.05rem;
    color: var(--primary-dark);
    font-weight: 500;
    margin: 0;
}

.intro-section,
.topics-section,
.about-section {
    margin-bottom: 3rem;
}

.intro-section h2,
.topics-section h2,
.about-section h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.intro-section p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.topic-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.topic-card.available {
    cursor: pointer;
}

.topic-card.available:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.topic-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.topic-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.topic-card h3 {
    margin: 0 0 0.5rem;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.topic-card p {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    flex-grow: 1;
}

.topic-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topic-card.available .topic-status {
    color: var(--secondary-color);
}

.topic-card.coming-soon .topic-status {
    color: var(--text-muted);
}

/* Quiz card with sublinks */
.quiz-card {
    cursor: default;
}

.topic-sublinks {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.topic-sublinks a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
}

.topic-sublinks a:hover {
    background: var(--primary-dark);
}

/* About Section */
.about-section p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.disclaimer-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 1.25rem;
    color: #991b1b;
}

.disclaimer-box > strong {
    display: block;
    margin-bottom: 0.5rem;
}

.disclaimer-box p strong {
    display: inline;
}

.disclaimer-box p {
    margin: 0;
    font-size: 0.95rem;
}

/* About Page Styles */
.hero-small {
    padding: 2.5rem 2rem;
}

.content-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.about-disclaimer {
    margin-bottom: 2rem;
}

.disclaimer-box.prominent {
    padding: 2rem;
}

.disclaimer-box.prominent h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    white-space: nowrap;
}

.disclaimer-box.prominent p {
    margin-bottom: 1rem;
}

.disclaimer-list {
    margin: 0;
    padding-left: 1.25rem;
}

.disclaimer-list li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.disclaimer-list a {
    color: #991b1b;
    font-weight: 500;
}

.about-content {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.about-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about-content p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Original Styles (Disclaimer Banner, Header, etc.)
   ========================================================================== */

/* Disclaimer Banner */
.disclaimer-banner {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    text-align: center;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
}

.disclaimer-banner strong {
    text-transform: uppercase;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

header .subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

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

/* Sections */
section {
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

/* Concept Cards */
.concept-card {
    background: var(--background-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.concept-card h3 {
    margin-top: 0;
    color: var(--primary-dark);
}

.concept-card ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.concept-card li {
    margin: 0.3rem 0;
}

/* Half-time Visual */
.half-time-visual {
    margin: 1rem 0;
}

.half-time-bar {
    background: var(--border-color);
    border-radius: 4px;
    margin: 0.5rem 0;
    height: 28px;
    position: relative;
}

.half-time-bar .bar-fill {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Table of Contents */
.toc {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.toc h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.toc li {
    margin: 0;
}

.toc a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toc a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Learn More (collapsible) */
.learn-more {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.learn-more summary {
    padding: 1rem;
    cursor: pointer;
    background: var(--background-color);
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--primary-color);
}

.learn-more summary:hover {
    background: var(--border-color);
}

.learn-more[open] summary {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border-color);
}

.math-content {
    padding: 1.5rem;
}

.math-content h4 {
    color: var(--primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.math-content h4:first-child {
    margin-top: 0;
}

.formula {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.formula-inline {
    background: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: 'Times New Roman', serif;
}

/* Data Table (for educational content) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.data-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.data-table tr:nth-child(even) {
    background: var(--background-color);
}

.data-table tr:hover {
    background: #e8f4fc;
}

.note {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
}

/* Profile Input */
.profile-controls {
    margin-top: 1rem;
}

#profile-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

#profile-table th,
#profile-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: center;
}

#profile-table th {
    background: var(--background-color);
    font-weight: 600;
}

#profile-table input {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

#profile-table input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.2);
}

.button-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.surface-interval-input {
    margin: 1rem 0;
}

.surface-interval-input label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.surface-interval-input input {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

/* Gradient Factors */
.gf-inputs {
    padding: 1rem 0;
}

.gf-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.gf-row .form-group {
    flex: 1;
    min-width: 200px;
}

.gf-row input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.gf-input {
    width: 70px !important;
    text-align: center;
}

.gf-presets {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gf-presets .hint {
    margin-right: 0.5rem;
}

.gf-preset {
    font-family: monospace;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--warning-color);
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

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

/* Validation Errors */
.errors {
    color: var(--warning-color);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.errors:empty {
    display: none;
}

/* Dive Stats */
.dive-stats {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    display: none;
}

.dive-stats.visible {
    display: block;
}

.dive-stats strong {
    color: var(--primary-dark);
}

/* Compartment Controls */
.compartment-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.compartment-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.compartment-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--background-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.compartment-toggle:hover {
    background: var(--border-color);
}

.compartment-toggle input {
    cursor: pointer;
}

.compartment-color,
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Chart */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chart-header h2 {
    margin: 0;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fullscreen-icon {
    font-size: 1.1rem;
}

.chart-container {
    position: relative;
    height: 700px;
    margin: 1rem 0;
}

/* Fullscreen mode */
.chart-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 1rem !important;
    background: var(--background-color);
    z-index: 9999;
    border-radius: 0;
}

.btn-fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    padding: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    box-shadow: var(--shadow);
    z-index: 10000;
}

.chart-container.fullscreen .btn-fullscreen-close {
    display: flex;
}

/* DiveProfileChart Component */
.dpc-chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.dpc-chart-container canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.dpc-chart-container.dpc-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000;
    background: var(--background-color, white);
    padding: 20px;
    box-sizing: border-box;
}

.dpc-chart-container .dpc-exit-fullscreen-btn {
    display: none;
}

.dpc-chart-container.dpc-fullscreen .dpc-fullscreen-btn {
    display: none;
}

.dpc-chart-container.dpc-fullscreen .dpc-exit-fullscreen-btn {
    display: block !important;
}

/* MValueChart Component */
.mvc-chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.mvc-chart-container canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.mvc-chart-container .mvc-exit-fullscreen-btn {
    display: none;
}

.mvc-chart-container.mvc-fullscreen .mvc-fullscreen-btn {
    display: none;
}

.mvc-chart-container.mvc-fullscreen .mvc-exit-fullscreen-btn {
    display: block !important;
}

.mvc-chart-container.mvc-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000;
    background: var(--background-color, white);
    padding: 20px;
    box-sizing: border-box;
}

.chart-legend {
    background: var(--background-color);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.chart-legend p {
    margin: 0.3rem 0;
}

/* Reference Table */
.reference-table {
    width: 100%;
    border-collapse: collapse;
}

.reference-table th,
.reference-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    text-align: left;
}

.reference-table th {
    background: var(--background-color);
    font-weight: 600;
}

.reference-table tr:hover {
    background: var(--background-color);
}

.footnote {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* References list */
.references-list {
    line-height: 1.8;
    padding-left: 1.5rem;
}

.references-list li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.references-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.references-list a:hover {
    text-decoration: underline;
}

.references-list em {
    font-style: italic;
}

/* ==========================================================================
   Quiz Styles
   ========================================================================== */

.quiz-section {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.quiz-categories {
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.quiz-categories h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.category-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.category-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: calc(var(--radius) / 2);
    transition: background-color 0.2s;
}

.category-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.category-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.quiz-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.quiz-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.quiz-setting input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.quiz-setting select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.quiz-container {
    margin-bottom: 1.5rem;
}

.question-card {
    animation: fadeIn 0.3s ease;
}

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

.question-number {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: #e8f4fc;
}

.option-btn:disabled {
    cursor: default;
}

.option-btn.correct {
    border-color: var(--secondary-color);
    background: #e8f8f0;
}

.option-btn.incorrect {
    border-color: var(--warning-color);
    background: #fef2f2;
}

.option-key {
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
}

.feedback {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}

.feedback-correct {
    background: #e8f8f0;
    border: 1px solid #a7f3d0;
}

.feedback-incorrect {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.feedback-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feedback-explanation {
    font-size: 0.95rem;
    line-height: 1.6;
}

.feedback-explanation ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.feedback-explanation li {
    margin: 0.25rem 0;
}

.quiz-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Results */
.results-card {
    text-align: center;
    padding: 2rem;
}

.results-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.results-card h2 {
    margin: 0 0 1.5rem;
    color: var(--primary-dark);
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.results-score .score-divider {
    color: var(--text-muted);
    margin: 0 0.25rem;
}

.results-percentage {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.results-message {
    font-size: 1.1rem;
    color: var(--text-color);
}

.quiz-info {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.quiz-info h3 {
    margin: 0 0 0.75rem;
    color: var(--primary-dark);
}

.quiz-info p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--text-color);
    color: white;
    padding: 2rem;
    text-align: center;
}

footer .wip-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

footer .wip-badge::before {
    content: "🧪 ";
}

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

footer .thank-you {
    font-style: italic;
    opacity: 0.9;
}

footer a {
    color: #85c1e9;
}

/* Version number in footer - keep in sync with sw.js CACHE_NAME */
.version-number {
    display: block;
    margin-top: 1rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

.version-number::after {
    content: "0.4.41";  /* ← UPDATE THIS with every push (keep in sync with sw.js) */
}

/* ==========================================================================
   DiveSetupEditor Component
   ========================================================================== */

.dive-setup-editor {
    font-size: 0.95rem;
}

.dse-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Profile Header - shows auto-generated name and key stats */
.dse-profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dse-profile-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dse-profile-icon {
    font-size: 1.5rem;
}

.dse-profile-name-text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.dse-profile-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dse-stat {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.dse-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
}

.dse-section summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0;
    user-select: none;
}

.dse-section summary:hover {
    color: var(--primary-color);
}

.dse-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.dse-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.dse-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.dse-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dse-field label {
    font-size: 0.85rem;
    font-weight: 500;
}

.dse-field input[type="number"],
.dse-field input[type="text"],
.dse-field textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
}

.dse-field input[type="range"] {
    width: 100%;
}

/* Quick Setup */
.dse-quick-inputs {
    margin-top: 0.75rem;
}

.dse-ndl-display {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    font-size: 0.9rem;
}

.dse-ndl-ok { color: var(--secondary-color); }
.dse-ndl-warning { color: #f39c12; }
.dse-ndl-deco { color: var(--warning-color); }

.dse-deco-warning {
    color: var(--warning-color);
    font-weight: 600;
}

/* Gases */
.dse-gases-content {
    margin-top: 0.75rem;
}

.dse-gases-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dse-gas-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    background: rgba(0,0,0,0.02);
}

.dse-gas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dse-gas-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.dse-gas-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dse-gas-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dse-gas-row label {
    font-size: 0.85rem;
    min-width: 30px;
}

.dse-gas-row select,
.dse-gas-row input {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

.dse-gas-o2,
.dse-gas-he {
    width: 50px;
}

.dse-gas-mod {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Gradient Factors */
.dse-gf-content {
    margin-top: 0.75rem;
}

.dse-gf-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.dse-gf-row .dse-field {
    flex: 1;
    min-width: 150px;
}

.dse-gf-row input[type="number"] {
    width: 60px;
}

.dse-gf-presets {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Waypoints Table */
.dse-waypoints h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.dse-waypoints-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.dse-waypoints-table th,
.dse-waypoints-table td {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.dse-waypoints-table th {
    background: rgba(0,0,0,0.05);
    font-weight: 600;
    font-size: 0.85rem;
}

.dse-waypoints-table input {
    width: 70px;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.85rem;
}

.dse-waypoints-table select {
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.85rem;
}

.dse-wp-actions {
    display: flex;
    gap: 0.25rem;
}

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

/* Multi-dive */
.dse-dive2 {
    border-left: 3px solid var(--primary-color);
}

.dse-dive2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.dse-dive2-header h4 {
    margin: 0;
}

.dse-si-between {
    margin-bottom: 0.75rem;
}

.dse-add-dive {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Surface Interval */
.dse-surface-interval .dse-field {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.dse-surface-interval input {
    width: 80px;
}

/* Import/Export */
.dse-import-export {
    display: flex;
    gap: 0.5rem;
}

/* Validation Errors */
.dse-validation-errors {
    display: none;
}

.dse-error {
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--warning-color);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    color: var(--warning-color);
}

/* Profile selector */
.dse-profiles {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dse-profile-select {
    flex: 1;
    max-width: 300px;
}

/* Compact mode */
.dive-setup-editor.dse-compact .dse-section {
    padding: 0.75rem;
}

.dive-setup-editor.dse-compact .dse-hint {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    /* Navigation - Hamburger Menu */
    .nav-container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        position: relative;
    }

    .nav-hamburger {
        display: flex;
        order: 2;
    }

    .nav-logo {
        order: 1;
        padding: 0;
        flex: 1;
    }

    .nav-wip-badge {
        order: 3;
        display: none;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 4;
        gap: 0;
        padding: 0.5rem 0 0;
        margin-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        max-height: 70vh;
        overflow-y: auto;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        padding: 0.85rem 0.5rem;
        font-size: 1rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .nav-links a.active {
        border-bottom: none;
        border-left-color: var(--secondary-color);
        background: rgba(255, 255, 255, 0.08);
    }

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

    /* Hide dropdown menus on mobile - show only top-level links */
    .nav-dropdown > a::after {
        content: none;
    }

    .nav-dropdown.open > a::after {
        content: none;
    }

    .nav-dropdown-menu {
        display: none;
    }

    /* Landing Page */
    .hero {
        padding: 2.5rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

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

    /* Original responsive */
    main {
        padding: 1rem;
    }

    section {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 400px;
    }

    .chart-container.fullscreen {
        height: 100vh;
        padding: 0.5rem;
    }

    .chart-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fullscreen-text {
        display: none;
    }

    .compartment-toggles {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    #profile-table input {
        width: 60px;
    }

    .button-row {
        flex-direction: column;
    }
}

/* ==========================================================================
   Dive Setup Page - Editable Form Styles
   ========================================================================== */

.text-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    width: 200px;
}

.text-input.wide {
    width: 100%;
    max-width: 500px;
}

.gas-mix-inputs .info-row {
    margin-bottom: 0.75rem;
}

.gas-mix-inputs .hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.profile-table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    margin: 1rem 0;
}

.profile-table th,
.profile-table td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.profile-table input {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.save-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.save-status.success {
    color: var(--secondary-color);
    font-weight: 500;
}

.save-status.error {
    color: var(--danger-color);
    font-weight: 500;
}

/* Profile Summary in Tissue Loading */
.profile-summary-content {
    line-height: 1.6;
}

.profile-summary-content details {
    margin-top: 1rem;
}

.profile-summary-content summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
}

.waypoints-preview {
    margin-top: 0.5rem;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.waypoints-preview th,
.waypoints-preview td {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: right;
}

.waypoints-preview th {
    background: var(--background-color);
}

/* Profile Selector */
.profile-selector {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-selector > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.profile-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-card {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-background);
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-card:hover {
    border-color: var(--primary-color);
    background: var(--background-color);
}

.profile-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(41, 128, 185, 0.1) 0%, rgba(41, 128, 185, 0.05) 100%);
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.2);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.profile-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.2;
}

.profile-card-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    font-weight: 500;
}

.profile-card-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.profile-card-delete:hover {
    opacity: 1;
    color: var(--danger-color, #e74c3c);
}

.profile-card-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-card-stats span {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .profile-card {
        min-width: 100%;
        max-width: 100%;
    }
}

/* Gas Cards for Multi-Gas Setup */
.gases-container {
    margin-bottom: 1.5rem;
}

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

.gases-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.gases-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.gas-card {
    flex: 1 1 180px;
    max-width: 250px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-background);
}

.gas-card.bottom-gas {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(41, 128, 185, 0.1) 0%, rgba(41, 128, 185, 0.05) 100%);
}

.gas-card.deco-gas {
    border-color: var(--success-color, #27ae60);
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.05) 100%);
}

.gas-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.gas-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.gas-card-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
}

.gas-card-badge.bottom {
    background: var(--primary-color);
    color: white;
}

.gas-card-badge.deco {
    background: var(--success-color, #27ae60);
    color: white;
}

.gas-card-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.gas-card-delete:hover {
    opacity: 1;
    color: var(--danger-color, #e74c3c);
}

.gas-card-content {
    font-size: 0.85rem;
}

.gas-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    color: var(--text-muted);
}

.gas-card-row span:last-child {
    color: var(--text-color);
    font-weight: 500;
}

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

/* Smaller select for waypoint gas dropdown */
.form-select-small {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    min-width: 100px;
}

/* Waypoint actions container (below table) */
.waypoint-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

/* Waypoint actions cell (in table row) */
.waypoint-actions-cell {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

/* Icon button for waypoint actions */
.btn-icon {
    padding: 0.25rem 0.5rem;
    min-width: unset;
    font-size: 1rem;
    line-height: 1;
}

.btn-icon.btn-small {
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
}

/* Time shift buttons */
.time-shift-up, .time-shift-down {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.time-shift-up:hover, .time-shift-down:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Insert waypoint button */
.insert-waypoint {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--success-color, #27ae60);
}

.insert-waypoint:hover {
    background: var(--success-color, #27ae60);
    border-color: var(--success-color, #27ae60);
    color: white;
}

/* Profile selector header with new profile button */
.profile-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.profile-selector-header label {
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

@media (max-width: 480px) {
    .gas-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .gases-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Textarea for description */
textarea.form-input {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Advanced/Collapsible Sections */
.advanced-section {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--background-color);
}

.advanced-section summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    list-style: none;
}

.advanced-section summary::-webkit-details-marker {
    display: none;
}

.advanced-section summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.advanced-section[open] summary::before {
    transform: rotate(90deg);
}

.advanced-section .gas-mix-grid {
    padding: 1rem;
    padding-top: 0.5rem;
}

/* Quick Setup Section */
.quick-setup-inputs {
    padding: 1rem;
}

.quick-setup-inputs .hint {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.quick-setup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.quick-setup-row .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.quick-setup-row .form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.quick-setup-row .form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
}

.quick-setup-row .btn {
    flex-shrink: 0;
    height: fit-content;
}

/* Safety Stop Row */
.safety-stop-row {
    margin-top: 0.5rem;
    align-items: center;
}

.safety-stop-row .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    min-width: 120px;
}

.safety-stop-row .safety-stop-field {
    flex: 0 0 auto;
    min-width: 80px;
}

.safety-stop-row .safety-stop-field .form-input {
    width: 70px;
}

/* DiveSetupEditor safety stop row */
.dse-safety-stop-row {
    margin-top: 0.5rem;
    align-items: center;
}

.dse-safety-stop-row .dse-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    min-width: 110px;
}

.dse-safety-stop-row .dse-safety-stop-field {
    flex: 0 0 auto;
}

.dse-safety-stop-row .dse-safety-stop-field .form-input {
    width: 60px;
}

@media (max-width: 600px) {
    .quick-setup-row {
        flex-direction: column;
    }
    
    .quick-setup-row .form-group {
        width: 100%;
    }
    
    .quick-setup-row .btn {
        width: 100%;
    }
    
    .safety-stop-row {
        flex-wrap: wrap;
    }
}

/* NDL Display */
.ndl-display {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.ndl-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ndl-label {
    color: var(--text-secondary);
}

.ndl-value {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--primary-color);
}

.ndl-status {
    font-size: 0.9em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.ndl-status.ndl-ok {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.ndl-status.ndl-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.ndl-status.ndl-deco {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.deco-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
}

.deco-warning {
    color: #e74c3c;
    font-weight: 500;
}

.deco-time {
    font-weight: bold;
    color: #e74c3c;
}

/* Profile Header Bar (for theory pages) */
.profile-header-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.6rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Sticky variant - sticks below the nav */
.profile-header-bar.sticky {
    position: sticky;
    top: 52px; /* Height of nav bar */
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-header-label {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Profile Switcher Dropdown */
.profile-switcher {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 0.4rem 2rem 0.4rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    min-width: 180px;
    transition: background-color 0.2s;
}

.profile-switcher:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.profile-switcher:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.profile-switcher option {
    background: var(--primary-dark);
    color: white;
    padding: 0.5rem;
}

.profile-header-summary {
    opacity: 0.85;
    font-size: 0.9rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.surface-interval-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.surface-interval-inline input {
    width: 70px;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.profile-header-bar .btn-small {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.profile-header-bar .btn-small:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chart Controls */
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.chart-controls .control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-controls .control-group label {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.chart-controls .form-select,
.chart-controls .form-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 80px;
}

.chart-controls .form-select {
    min-width: 120px;
}

/* Stats Summary */
.stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: var(--radius);
    margin-top: 1rem;
}

.stats-summary .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-summary .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stats-summary .stat-value {
    font-size: 1rem;
    font-weight: 600;
}

/* Multi-Gas Tank Summary */
.gas-tanks-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.tank-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent-color);
    min-width: 180px;
    flex: 1;
}

.tank-summary-item.ok {
    border-left-color: #27ae60;
}

.tank-summary-item.warning {
    border-left-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.tank-summary-item.danger {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.tank-summary-item .tank-name {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.tank-summary-item .tank-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tank-summary-item .tank-remaining {
    font-weight: 600;
    color: var(--text-color);
}

.tank-summary-item.warning .tank-remaining {
    color: #f39c12;
}

.tank-summary-item.danger .tank-remaining {
    color: #e74c3c;
}

.surface-interval-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.surface-interval-control input {
    width: 70px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

/* Form Group Styles (for dive-setup) */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Dive Sections (multi-dive support) */
.dive-section {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-background);
}

.dive-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.dive2-section {
    border-color: var(--primary-color);
    background: linear-gradient(to bottom, rgba(41, 128, 185, 0.05), var(--card-background));
}

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

.dive2-header h3 {
    margin: 0;
}

.surface-interval-between {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: var(--radius);
}

.surface-interval-between input {
    width: 100px;
}

.add-dive-section {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    background: var(--background-color);
}

.add-dive-section .hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Terminology Legend (Pressure page)
   ========================================================================== */

.terminology-legend {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.terminology-legend h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-dark);
}

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

.term-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: var(--radius);
    border-left: 4px solid var(--border-color);
}

.term-marker {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-top: 4px;
    flex-shrink: 0;
}

.term-marker.descent {
    background: #2ecc71;
    border-left-color: #2ecc71;
}

.term-item:has(.term-marker.descent) {
    border-left-color: #2ecc71;
}

.term-marker.bottom-time {
    background: #f1c40f;
}

.term-item:has(.term-marker.bottom-time) {
    border-left-color: #f1c40f;
}

.term-marker.max-depth {
    background: #e74c3c;
}

.term-item:has(.term-marker.max-depth) {
    border-left-color: #e74c3c;
}

.term-marker.ascent {
    background: #9b59b6;
}

.term-item:has(.term-marker.ascent) {
    border-left-color: #9b59b6;
}

.term-marker.tdt {
    background: #34495e;
}

.term-item:has(.term-marker.tdt) {
    border-left-color: #34495e;
}

.term-marker.deco-stop {
    background: #e67e22;
}

.term-item:has(.term-marker.deco-stop) {
    border-left-color: #e67e22;
}

.term-marker.safety-stop {
    background: #3498db;
}

.term-item:has(.term-marker.safety-stop) {
    border-left-color: #3498db;
}

.term-marker.surface-interval {
    background: #3498db;
    border: 2px dashed #3498db;
    background: rgba(52, 152, 219, 0.3);
}

.term-item:has(.term-marker.surface-interval) {
    border-left-color: #3498db;
    border-left-style: dashed;
}

.term-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.term-content strong {
    color: var(--text-color);
    font-size: 0.95rem;
}

.term-content span {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Stats Section */
.stats-section {
    margin-top: 2rem;
}

.stats-section h2 {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .profile-header-bar.sticky {
        top: 48px; /* Adjust for smaller nav on mobile */
    }
    
    .profile-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-header-info {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .profile-switcher {
        width: 100%;
        min-width: unset;
    }
    
    .profile-header-summary {
        border-left: none;
        padding-left: 0;
        font-size: 0.85rem;
    }
    
    .profile-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .term-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Partial Pressure & Gas Composition Styles
   ========================================================================== */

/* Warning/Info Card Variants */
.concept-card.warning-card {
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(135deg, #fff5f5 0%, var(--card-background) 100%);
}

.concept-card.info-card {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #f0f8ff 0%, var(--card-background) 100%);
}

/* Highlight Box (Martini Rule etc) */
.highlight-box {
    background: linear-gradient(135deg, #fef9e7 0%, #fcf3cf 100%);
    border: 1px solid #f9e79f;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1rem 0;
}

.highlight-box h4 {
    margin: 0 0 0.75rem 0;
    color: #9a7b4f;
    font-size: 1.1rem;
}

.highlight-box p {
    margin: 0.5rem 0;
}

.highlight-box ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

/* Table Row Status Colors */
.data-table tr.safe-row {
    background-color: rgba(46, 204, 113, 0.1);
}

.data-table tr.warning-row {
    background-color: rgba(241, 196, 15, 0.15);
}

.data-table tr.danger-row {
    background-color: rgba(231, 76, 60, 0.1);
}

/* Small Chart Container */
.chart-container-small {
    max-width: 350px;
    margin: 1.5rem auto;
}

/* Stat Value Status Colors */
.stat-value.safe {
    color: #27ae60;
}

.stat-value.warning {
    color: #f39c12;
}

.stat-value.danger {
    color: #e74c3c;
    font-weight: 600;
}

/* Gas Display in Controls */
.control-group.gas-display {
    background: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Collapsible Section with Toggle */
.concept-card.collapsible .collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.concept-card.collapsible .collapsible-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Small Table Variant */
.data-table.small-table {
    font-size: 0.85rem;
}

.data-table.small-table th,
.data-table.small-table td {
    padding: 0.4rem 0.75rem;
}

/* Warning Text */
.warning-text {
    color: var(--warning-color);
    font-weight: 500;
    padding: 0.75rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* ==========================================================================
   Gas Pathway Visualization
   ========================================================================== */

.gas-pathway-container {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.gas-pathway-phase-indicator {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
}

.gas-pathway-phase-indicator .phase-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2980b9;
    transition: color 0.3s ease;
}

.gas-pathway-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.gas-pathway-controls .btn.btn-active {
    background: var(--primary-color);
    color: white;
}

.gas-pathway-svg {
    width: 100%;
    max-width: 700px;
    height: auto;
    min-height: 200px;
}

.gas-pathway-svg .stage-box {
    stroke: var(--primary-color);
    stroke-width: 2;
    fill: url(#pressureGradientDescent);
    transition: fill 0.5s ease;
}

.gas-pathway-svg .stage-icon {
    font-size: 24px;
}

.gas-pathway-svg .stage-label {
    font-size: 12px;
    fill: var(--text-color);
    font-weight: 500;
}

.gas-pathway-svg .stage-value {
    font-size: 10px;
    fill: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.gas-pathway-svg .tissue-label {
    font-size: 10px;
    fill: var(--text-color);
}

.gas-pathway-svg .tissue-fill {
    transition: width 0.5s ease;
}

.gas-pathway-svg .legend-text {
    font-size: 11px;
    fill: var(--text-muted);
}

.gas-pathway-svg .legend-direction {
    font-weight: 600;
    fill: var(--primary-color);
}

.gas-pathway-svg .gas-particle {
    opacity: 0.8;
}

.gas-pathway-svg .arrow-line {
    transition: stroke 0.3s ease;
}

.gas-pathway-svg .arrow-head {
    transition: fill 0.3s ease, display 0.3s ease;
}

.gas-pathway-svg .gradient-bar {
    fill: url(#pressureGradientDescent);
    transition: fill 0.5s ease;
}

/* ==========================================================================
   Dive Phase Cards
   ========================================================================== */

.dive-phases {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.dive-phase {
    background: var(--background-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary-color);
}

.dive-phase:nth-child(1) {
    border-left-color: #3498db;
}

.dive-phase:nth-child(2) {
    border-left-color: #9b59b6;
}

.dive-phase:nth-child(3) {
    border-left-color: #e67e22;
}

.dive-phase h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-dark);
    font-size: 1rem;
}

.dive-phase p {
    margin: 0.5rem 0;
}

.phase-formula {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Half-Time Interactive Charts
   ========================================================================== */

.half-time-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 1.5rem 0;
}

.half-time-chart-wrapper {
    background: var(--background-color);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.half-time-chart-wrapper h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-dark);
}

.half-time-chart-wrapper .chart-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.chart-controls-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.chart-controls-inline label {
    font-weight: 500;
    color: var(--text-color);
}

.chart-controls-inline input[type="range"] {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}

.chart-controls-inline select {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.9rem;
}

.chart-controls-inline span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

#ongassing-depth-value,
#offgassing-ppn2-value,
#ongassing-ppn2-value {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
}

/* ============================================================================
   M-Values Page - Time Overlay & Timeline Controls
   ============================================================================ */

/* Time overlay on chart */
.time-overlay {
    position: absolute;
    top: 50px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.time-overlay #overlay-time {
    font-size: 2rem;
}

.time-overlay #overlay-depth {
    color: #3498db;
    font-size: 1.5rem;
}

/* Fullscreen adjustments for overlay */
.chart-container.fullscreen .time-overlay {
    top: 20px;
    right: 30px;
    font-size: 2rem;
}

.chart-container.fullscreen .time-overlay #overlay-time {
    font-size: 3rem;
}

.chart-container.fullscreen .time-overlay #overlay-depth {
    font-size: 2rem;
}

/* Timeline controls inline (below chart) */
.timeline-controls-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.timeline-controls-inline .btn-icon {
    font-size: 1.5rem;
    padding: 0.5rem;
    min-width: 50px;
    text-align: center;
}

.timeline-controls-inline .btn-step {
    font-size: 1rem;
    min-width: 40px;
    padding: 0.4rem;
    opacity: 0.8;
}

.timeline-controls-inline .btn-step:hover {
    opacity: 1;
}

.timeline-controls-inline .timeline-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.timeline-controls-inline .timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.timeline-controls-inline .timeline-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.timeline-info-compact {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 100px;
}

.timeline-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gas-pathway-svg {
        min-height: 180px;
    }
    
    .half-time-chart-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-controls-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls-inline input[type="range"] {
        width: 100%;
        max-width: none;
    }
    
    .time-overlay {
        top: 40px;
        left: 50px;
        font-size: 1rem;
        padding: 0.3rem 0.6rem;
    }
    
    .time-overlay #overlay-time {
        font-size: 1.3rem;
    }
    
    .time-overlay #overlay-depth {
        font-size: 1rem;
    }
    
    .timeline-controls-inline {
        flex-wrap: wrap;
    }
    
    .timeline-controls-inline .timeline-slider {
        order: 2;
        width: 100%;
        flex: none;
    }
}

/* Sandbox link */
.sandbox-link {
    display: block;
    text-align: center;
    margin-top: 2.5rem;
    padding: 0.5rem 1rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.sandbox-link:hover {
    text-decoration: underline;
    color: var(--accent-hover, #3498db);
}

/* ==========================================================================
   M-Values Page - Educational Components
   ========================================================================== */

/* Pressure Comparison Layout */
.pressure-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
}

.pressure-item {
    text-align: center;
    padding: 1rem;
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex: 1;
    min-width: 150px;
}

.pressure-item strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.pressure-comparison-vs {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: bold;
}

/* Key Insight Box */
.key-insight {
    background: linear-gradient(135deg, #e8f6f3 0%, #d5f5e3 100%);
    border: 1px solid #82e0aa;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.key-insight h4 {
    margin: 0 0 1rem 0;
    color: #1e8449;
}

.key-insight table {
    width: 100%;
    margin-bottom: 0;
}

/* Ratio Highlight (supersaturation ratios) */
.ratio-highlight {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.ratio-box {
    background: linear-gradient(135deg, #f4ecf7 0%, #e8daef 100%);
    border: 1px solid #bb8fce;
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    min-width: 180px;
}

.ratio-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ratio-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #7d3c98;
    margin: 0.25rem 0;
}

.ratio-desc {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.ratio-math {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.ratio-arrow {
    font-size: 2rem;
    color: var(--text-muted);
}

/* History Content in Learn More */
.history-content {
    padding: 1.5rem;
}

.history-content h4 {
    color: var(--primary-dark);
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--border-color);
}

.history-content h4:first-child {
    margin-top: 0;
}

/* Formula Content in Learn More */
.formula-content {
    padding: 1.5rem;
}

.formula-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.formula-content li {
    margin-bottom: 0.5rem;
}

/* Diagram Zones */
.diagram-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.zone-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.zone-item .zone-marker {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.zone-item .zone-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.zone-safe {
    background: #f0e6f6;
    border-left-color: #9b59b6;
}

.zone-offgas {
    background: #e8f4fc;
    border-left-color: #3498db;
}

.zone-super {
    background: #e8f8f5;
    border-left-color: #27ae60;
}

.zone-danger {
    background: #fdedec;
    border-left-color: #e74c3c;
}

/* Movement Guide */
.movement-guide {
    padding: 1.5rem;
}

.movement-guide ul {
    margin: 0;
    padding-left: 1.5rem;
}

.movement-guide li {
    margin-bottom: 0.75rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .pressure-comparison {
        flex-direction: column;
    }
    
    .pressure-comparison-vs {
        transform: rotate(90deg);
        font-size: 1rem;
    }
    
    .ratio-highlight {
        flex-direction: column;
    }
    
    .ratio-arrow {
        transform: rotate(90deg);
    }
}