/* styles.css - Main Stylesheet for EKG Simulator */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container Styles */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container h1 {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-container h2 {
    font-size: 1.5em;
    font-weight: 300;
    opacity: 0.9;
}

/* Menu Card */
.menu-container {
    width: 100%;
    max-width: 500px;
}

.menu-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-card h3 {
    font-size: 2em;
    margin-bottom: 15px;
    text-align: center;
}

.menu-card p {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Button Styles */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffd89b 0%, #ff9a00 100%);
    color: #333;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.icon {
    font-size: 1.3em;
}

/* Info Section */
.info-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.info-text {
    font-size: 0.9em;
    line-height: 1.6;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ff6b6b;
}

.modal-content h3 {
    margin-bottom: 15px;
    font-size: 1.8em;
}

.modal-content p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    font-size: 1.2em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.error-message {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    color: #ffaaaa;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== SIMULATOR STYLES ==================== */

.simulator-body {
    background: #0a0a0a;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.session-code {
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 2px;
}

.current-time {
    font-size: 1.1em;
    font-weight: 300;
    font-family: 'Courier New', monospace;
}

/* Simulator Container */
.simulator-container {
    margin-top: 50px;
    height: calc(100vh - 50px);
    display: flex;
    position: relative;
}

/* EKG Monitor */
.ekg-monitor {
    flex: 1;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.monitor-header {
    background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
}

.monitor-header h2 {
    font-size: 1.5em;
    font-weight: 600;
}

.monitor-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: auto;
}

/* EKG Waveform */
.ekg-waveform {
    background: #000;
    border: 2px solid #333;
    border-radius: 10px;
    height: 250px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

#ekgCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Vital Signs */
.vital-signs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.vital-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

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

.vital-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 10px;
}

.vital-value {
    font-size: 2.5em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.vital-unit {
    font-size: 0.9em;
    opacity: 0.7;
}

/* Special colors for different vitals */
.hr-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
}

.spo2-card {
    background: linear-gradient(135deg, #4dabf7 0%, #1971c2 100%);
}

.bp-card {
    background: linear-gradient(135deg, #51cf66 0%, #2b8a3e 100%);
}

.etco2-card {
    background: linear-gradient(135deg, #ffd43b 0%, #f08c00 100%);
}

.rr-card {
    background: linear-gradient(135deg, #da77f2 0%, #9c36b5 100%);
}

/* Alarm Display */
.alarm-display {
    min-height: 50px;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alarm-item {
    background: rgba(255, 107, 107, 0.3);
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 600;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Defibrillator Panel */
.defib-panel {
    position: fixed;
    left: -500px;
    top: 50px;
    width: 450px;
    height: calc(100vh - 50px);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 200;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.defib-panel.active {
    left: 0;
}

.panel-header {
    background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-header h3 {
    font-size: 1.3em;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.3s;
}

.close-panel:hover {
    color: #ff6b6b;
}

.panel-content {
    padding: 20px;
}

.panel-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-section h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #64b5f6;
}

/* Energy Controls */
.energy-display {
    font-size: 3em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    color: #ffd43b;
}

.energy-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-control {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1.5em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-control:hover {
    transform: scale(1.1);
}

.energy-controls input[type="range"] {
    flex: 1;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
}

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

.defib-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.defib-actions .btn {
    flex: 1;
    min-width: 100px;
}

.charge-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
}

.charge-status.charged {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #ffd700;
    color: #ffd700;
}

/* Form Elements */
.form-select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
    font-size: 1em;
}

.form-select option {
    background: #1a1a2e;
    color: white;
}

/* NIBP Result */
.nibp-result {
    margin-top: 15px;
    padding: 10px;
    background: rgba(100, 181, 246, 0.2);
    border-radius: 5px;
    text-align: center;
}

/* Alarm Settings */
.alarm-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alarm-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.alarm-item label {
    font-weight: 600;
    color: #64b5f6;
}

.alarm-item input {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
    font-size: 1em;
}

.mute-status {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 165, 0, 0.2);
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
}

/* Vitals Section */
.vitals-section {
    background: rgba(100, 181, 246, 0.1) !important;
}

.scenario-select {
    margin-bottom: 20px;
}

.scenario-select label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #64b5f6;
}

.vitals-sliders {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-item label {
    font-size: 0.95em;
    font-weight: 500;
}

.slider-item span {
    color: #ffd43b;
    font-weight: bold;
}

/* Online Status */
.online-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    text-align: center;
}

.online-status h3 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #4ade80;
}

.join-code-display p {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.code-box {
    font-size: 3em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 40px;
    border-radius: 10px;
    letter-spacing: 5px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Shock Effect */
.shock-effect {
    animation: shock 0.5s ease;
}

@keyframes shock {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .defib-panel {
        width: 100%;
        left: -100%;
    }

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

    .top-bar {
        padding: 0 15px;
    }

    .monitor-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .monitor-header h2 {
        font-size: 1.2em;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
