/* SURGEON SIMULATOR: EXTREME EDITION - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    overflow: hidden;
    cursor: default;
}

.hidden {
    display: none !important;
}

/* Game Container */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Title Screen */
#title-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #1a0000 0%, #0d0d0d 50%, #1a0000 100%);
    position: relative;
}

.title-text {
    font-size: 5rem;
    font-weight: 900;
    color: #ff0000;
    text-shadow: 
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        0 0 40px #990000,
        4px 4px 0 #660000;
    letter-spacing: 0.1em;
    animation: pulse-glow 2s ease-in-out infinite;
}

.subtitle {
    font-size: 2rem;
    color: #cc0000;
    text-shadow: 0 0 10px #cc0000;
    margin-top: 10px;
    letter-spacing: 0.5em;
}

.warning {
    color: #ffcc00;
    margin-top: 30px;
    font-size: 0.9rem;
    animation: blink 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 40px #990000, 4px 4px 0 #660000; }
    50% { text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000, 0 0 60px #990000, 4px 4px 0 #660000; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.menu-btn {
    margin-top: 40px;
    padding: 20px 60px;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(180deg, #cc0000 0%, #660000 100%);
    color: white;
    border: 3px solid #ff0000;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.menu-btn:hover {
    background: linear-gradient(180deg, #ff0000 0%, #990000 100%);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
}

.exit-btn {
    background: linear-gradient(180deg, #444 0%, #222 100%);
    border-color: #666;
    box-shadow: 0 0 20px rgba(100, 100, 100, 0.5);
    margin-top: 20px;
}

.exit-btn:hover {
    background: linear-gradient(180deg, #666 0%, #333 100%);
    box-shadow: 0 0 40px rgba(150, 150, 150, 0.8);
}

/* In-game menu controls */
#game-menu-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #444;
}

.menu-control-btn {
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border: 2px solid #666;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
}

.menu-control-btn:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    transform: scale(1.02);
}

.title-decoration {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 100px;
}

.blood-drip {
    width: 20px;
    height: 100px;
    background: linear-gradient(180deg, #8b0000 0%, transparent 100%);
    border-radius: 0 0 10px 10px;
    animation: drip 3s ease-in-out infinite;
}

.blood-drip:nth-child(2) { animation-delay: 1s; }
.blood-drip:nth-child(3) { animation-delay: 2s; }

@keyframes drip {
    0% { height: 0; opacity: 0; }
    50% { height: 150px; opacity: 1; }
    100% { height: 200px; opacity: 0; }
}

/* Game Screen */
#game-screen {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

#hospital-room {
    width: 100%;
    height: 100vh;
    background: linear-gradient(180deg, #1a2a1a 0%, #0d1a0d 100%);
    position: relative;
    display: grid;
    grid-template-columns: 250px 1fr 200px;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
}

/* Vitals Monitor */
#vitals-monitor {
    grid-column: 1;
    grid-row: 1 / 3;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #444;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.5),
        0 0 30px rgba(0,255,0,0.1);
}

.monitor-screen {
    background: #001100;
    border: 2px solid #003300;
    border-radius: 10px;
    padding: 15px;
    box-shadow: inset 0 0 30px rgba(0,255,0,0.1);
}

.vital-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #003300;
}

.vital-label {
    color: #00ff00;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.vital-value {
    color: #00ff00;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px #00ff00;
}

.vital-unit {
    color: #009900;
    font-size: 0.8rem;
}

#ecg-canvas {
    width: 100%;
    height: 50px;
    background: #001100;
    border: 1px solid #003300;
    margin: 10px 0;
}

#pain-meter {
    width: 100px;
    height: 15px;
    background: #001100;
    border: 1px solid #003300;
    border-radius: 5px;
    overflow: hidden;
}

#pain-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
    transition: width 0.3s ease;
}

.status-stable { color: #00ff00 !important; }
.status-warning { color: #ffff00 !important; }
.status-critical { color: #ff0000 !important; animation: blink 0.5s infinite; }
.status-dead { color: #666666 !important; }

.monitor-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.monitor-led {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid #333;
}

.monitor-led.green { background: #00ff00; box-shadow: 0 0 10px #00ff00; }
.monitor-led.yellow { background: #333; }
.monitor-led.red { background: #333; }

.monitor-led.active.yellow { background: #ffff00; box-shadow: 0 0 10px #ffff00; }
.monitor-led.active.red { background: #ff0000; box-shadow: 0 0 10px #ff0000; animation: blink 0.3s infinite; }

/* Drug Panel */
#drug-panel {
    grid-column: 1;
    grid-row: 3;
    background: linear-gradient(180deg, #2a2a3a 0%, #1a1a2a 100%);
    border: 3px solid #444;
    border-radius: 15px;
    padding: 15px;
}

#drug-panel h3 {
    color: #00ccff;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.drug-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 100%);
    border: 2px solid #555;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.drug-btn:hover {
    background: linear-gradient(180deg, #4a4a5a 0%, #3a3a4a 100%);
    border-color: #00ccff;
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.3);
}

.drug-btn.mercy {
    background: linear-gradient(180deg, #4a2a2a 0%, #3a1a1a 100%);
    border-color: #660000;
}

.drug-btn.mercy:hover {
    background: linear-gradient(180deg, #5a3a3a 0%, #4a2a2a 100%);
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.drug-icon {
    font-size: 1.5rem;
}

.drug-name {
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.drug-desc {
    color: #888;
    font-size: 0.7rem;
    margin-left: auto;
}

/* Main Operation Canvas */
#operation-canvas {
    grid-column: 2;
    grid-row: 1 / 4;
    background: #0d2a0d;
    border: 5px solid #2a4a2a;
    border-radius: 20px;
    cursor: crosshair;
}

/* Tool Tray */
#tool-tray {
    grid-column: 3;
    grid-row: 1 / 3;
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 3px solid #555;
    border-radius: 15px;
    padding: 15px;
    overflow-y: auto;
}

#tool-tray h3 {
    color: #ffcc00;
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

#tools-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    padding: 12px 10px;
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 2px solid #555;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 100%);
    border-color: #ffcc00;
}

.tool-btn.selected {
    background: linear-gradient(180deg, #5a4a2a 0%, #4a3a1a 100%);
    border-color: #ffcc00;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.tool-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.tool-btn span {
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Zoom Controls */
#zoom-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #444;
}

.zoom-btn {
    background: linear-gradient(180deg, #4a6a8a 0%, #2a4a6a 100%);
    border: 2px solid #5a7a9a;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: linear-gradient(180deg, #5a7a9a 0%, #3a5a7a 100%);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

#zoom-level {
    color: #00ccff;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

/* Extraction Tray */
#extraction-tray {
    grid-column: 3;
    grid-row: 3;
    background: linear-gradient(180deg, #3a2a2a 0%, #2a1a1a 100%);
    border: 3px solid #553333;
    border-radius: 15px;
    padding: 15px;
}

#extraction-tray h3 {
    color: #ff6666;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

#extracted-items {
    min-height: 80px;
    background: #1a0a0a;
    border: 2px solid #330000;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: flex-start;
}

.extracted-item {
    font-size: 1.5rem;
    animation: pop-in 0.3s ease;
}

@keyframes pop-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.tray-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: #ff9999;
    font-size: 0.8rem;
}

/* Patient Info */
#patient-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.patient-photo {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #666 0%, #444 100%);
    border-radius: 50%;
    border: 2px solid #888;
}

.patient-details h4 {
    color: white;
    font-size: 1rem;
}

.patient-details p {
    color: #aaa;
    font-size: 0.75rem;
}

#patient-notes {
    color: #ffcc00 !important;
    font-style: italic;
}

/* Surgery Objectives Panel */
#objectives-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #444;
    border-radius: 15px;
    padding: 15px 25px;
    min-width: 350px;
    z-index: 15;
}

#objectives-panel h3 {
    color: #00ccff;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
}

#progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#progress-bar {
    flex: 1;
    height: 20px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00);
    transition: width 0.3s ease;
    border-radius: 8px;
}

#progress-text {
    color: #00ff00;
    font-weight: bold;
    font-size: 1rem;
    min-width: 45px;
}

#objectives-list {
    max-height: 120px;
    overflow-y: auto;
}

.objective-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #333;
}

.objective-item:last-child {
    border-bottom: none;
}

.objective-item.completed {
    text-decoration: line-through;
    opacity: 0.5;
}

.objective-icon {
    font-size: 1.2rem;
}

.objective-text {
    color: #ccc;
    flex: 1;
}

.objective-item.completed .objective-text {
    color: #00ff00;
}

.objective-status {
    font-size: 1rem;
}

#blood-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(139, 0, 0, 0.5);
    border: 2px solid #ff0000;
    border-radius: 8px;
    animation: blood-pulse 0.5s ease-in-out infinite;
}

#blood-warning .warning-icon {
    font-size: 1.5rem;
    animation: shake 0.3s ease-in-out infinite;
}

#blood-warning .warning-text {
    color: #ff0000;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
}

@keyframes blood-pulse {
    0%, 100% { background: rgba(139, 0, 0, 0.3); }
    50% { background: rgba(139, 0, 0, 0.7); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Message Area */
#message-area {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.game-message {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    animation: message-pop 0.3s ease;
    margin-bottom: 10px;
    border: 2px solid;
}

.game-message.success {
    border-color: #00ff00;
    color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.game-message.warning {
    border-color: #ffcc00;
    color: #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
}

.game-message.error {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.game-message.funny {
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

@keyframes message-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Drug Effects Overlay */
#drug-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#drug-effects.trippy {
    animation: trippy 0.5s ease-in-out infinite;
    background: radial-gradient(circle, 
        rgba(255,0,255,0.2) 0%, 
        rgba(0,255,255,0.2) 25%, 
        rgba(255,255,0,0.2) 50%, 
        rgba(0,255,0,0.2) 75%, 
        transparent 100%);
}

#drug-effects.drowsy {
    background: rgba(0, 0, 0, 0.5);
    animation: drowsy 2s ease-in-out infinite;
}

#drug-effects.alert {
    background: rgba(255, 255, 0, 0.1);
    animation: alert-flash 0.2s ease-in-out 3;
}

@keyframes trippy {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes drowsy {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes alert-flash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Game Over Screen */
#gameover-screen, #success-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #1a0000 0%, #0d0d0d 50%, #1a0000 100%);
}

#gameover-screen h1 {
    font-size: 4rem;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    animation: pulse-glow 1s ease-in-out infinite;
}

#gameover-message {
    color: #999;
    font-size: 1.2rem;
    margin-top: 20px;
}

#final-stats, #success-stats {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    border-radius: 15px;
    padding: 30px 50px;
    margin-top: 30px;
}

#final-stats p, #success-stats p {
    color: #ccc;
    font-size: 1.1rem;
    margin: 10px 0;
}

#final-stats span, #success-stats span {
    color: #ff6666;
    font-weight: bold;
}

#success-screen h1 {
    font-size: 3.5rem;
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
}

.success-message {
    color: #00cc00;
    font-size: 1.2rem;
    margin-top: 20px;
}

#success-stats span {
    color: #00ff00;
}

#surgery-rating {
    font-size: 2rem !important;
}

/* Cursor styles for tools */
.cursor-hand { cursor: grab; }
.cursor-scalpel { cursor: crosshair; }
.cursor-forceps { cursor: pointer; }
.cursor-syringe { cursor: cell; }
.cursor-suture { cursor: crosshair; }
.cursor-saw { cursor: not-allowed; }
.cursor-clamp { cursor: pointer; }
.cursor-vacuum { cursor: cell; }
.cursor-defibrillator { cursor: pointer; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #hospital-room {
        grid-template-columns: 200px 1fr 180px;
    }
    
    .title-text {
        font-size: 3rem;
    }
}

/* Blood splatter effect class */
.blood-splatter {
    position: absolute;
    pointer-events: none;
    animation: splatter 0.5s ease-out forwards;
}

@keyframes splatter {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Heartbeat line animation for flatline */
.flatline #ecg-canvas {
    animation: flatline-glow 0.5s ease-in-out infinite;
}

@keyframes flatline-glow {
    0%, 100% { box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.8); }
}
