/* Base Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: #007bff;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.35rem;
    color: #34495e;
}

h4 {
    font-size: 1.15rem;
    color: #2c3e50;
}

p {
    margin-bottom: 1rem;
}

/* Header & Navigation */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.logo h1 span {
    color: #007bff;
}

.logo p {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.nav-menu {
    display: flex;
    gap: 15px;
}

.nav-menu li a {
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu li a:hover,
.nav-menu li a:focus {
    background-color: #e9ecef;
    color: #0056b3;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h2 {
    border-bottom: none;
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

.btn.primary:hover,
.btn.primary:focus {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn.secondary:hover,
.btn.secondary:focus {
    background-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Section Styling */
section {
    padding: 3rem 0;
}

section:nth-child(even) {
    background-color: #fff;
}

.container > h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Calculator Section */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.calculator-section {
    background-color: #e9f4ff !important;
}

#ventilator-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

.slider-container span {
    min-width: 50px;
    font-weight: 600;
    color: #007bff;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 4px;
}

.checkbox-label .checkmark {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #007bff;
    border-radius: 3px;
    position: relative;
    margin-right: 10px;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 6px;
    height: 10px;
    border: solid #007bff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.results-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.results-container h3 {
    margin-top: 0;
    text-align: center;
    color: #007bff;
}

#results-output {
    min-height: 200px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

/* Modes Section */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.mode-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.mode-card:hover {
    transform: translateY(-5px);
}

.mode-card h3 {
    color: #007bff;
    margin-top: 0;
}

.mode-card ul {
    padding-left: 20px;
}

.mode-card li {
    margin-bottom: 8px;
    position: relative;
}

.mode-card li:before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* Settings Section */
.settings-tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-content {
    padding: 25px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

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

.parameter-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

/* Care Section */
.care-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.care-column h3 {
    color: #007bff;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.care-column ul {
    padding-left: 20px;
}

.care-column li {
    margin-bottom: 10px;
    position: relative;
}

.care-column li:before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    position: absolute;
    left: -20px;
}

/* Resources Section */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.resource-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s;
}

.resource-card:hover {
    transform: translateY(-5px);
}

.resource-card h3 {
    color: #007bff;
    margin-top: 0;
}

/* Content Pages */
.content-section {
    padding: 2rem 0;
}

.content-section:nth-child(even) {
    background-color: #fff;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.content-text p {
    font-size: 1.1rem;
    line-height: 1.7;
}

.content-text ul {
    padding-left: 20px;
    margin-bottom: 1.5rem;
}

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

.content-text li:before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

.placeholder-box {
    background-color: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.detail-card, .guideline-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.detail-card h3, .guideline-card h3 {
    color: #007bff;
    margin-top: 0;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.detail-card ul, .guideline-card ul {
    padding-left: 20px;
}

.detail-card li, .guideline-card li {
    margin-bottom: 8px;
    position: relative;
}

.detail-card li:before, .guideline-card li:before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

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

.med h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0 1.5rem;
}

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

.footer-section h3 {
    color: #007bff;
    margin-top: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #455a64;
    font-size: 0.9rem;
    color: #b0bec5;
}

/* Responsive Design */
@media (max-width: 992px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .parameter-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 10px 0;
    }
    
    header .container {
        flex-wrap: wrap;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .modes-grid,
    .care-content,
    .resources-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    section {
        padding: 2rem 0;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .cta-buttons {
        gap: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

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

:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}