:root {
    --midst-purple: #740e61ff;
    --midst-purple-hover: #570949ff;
    --grid-size: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #2a2a2a;
    color: #fff;
    height: 100vh;
    overflow: hidden;
}

.patient-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #1a1a1a;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
    flex-wrap: wrap;
}

.patient-data {
    text-align: center;
    margin: 5px 10px;
}

.patient-data strong {
    display: block;
    font-size: 14px;
    color: #ccc;
    margin-bottom: 4px;
}

.patient-data span {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.nav-container {
    display: flex;
    background: #1a1a1a;
    border-bottom: 1px solid #444;
}

.nav-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: #333;
    border: none;
    color: #ccc;
    cursor: pointer;
    border-right: 1px solid #444;
    font-size: 16px;
    transition: all 0.2s ease;
}

.nav-tab:last-child { border-right: none; }
.nav-tab:hover { background: #404040; color: #fff; }
.nav-tab.active { background: var(--midst-purple); color: #fff; }

.page {
    display: none;
    height: calc(100vh - 120px);
    position: relative;
}

.page.active { display: block; }

.page-content {
    height: 100%;
    padding: 20px;
    font-size: 16px;
    color: #ccc;
    overflow-y: auto;
}

.form-section {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #444;
}

.form-section h3 {
    margin-bottom: 10px;
    color: #fff;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #444;
    color: #fff;
}

.add-btn, .add-node-btn {
    background: var(--midst-purple);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.add-btn:hover, .add-node-btn:hover {
    background: var(--midst-purple-hover);
}

.tooltip-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
}

.tooltip-bottom .close-btn {
    margin-left: 10px;
    color: #aaa;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    font-weight: bold;
    transition: color 0.2s ease;
}

.tooltip-bottom .close-btn:hover { color: #fff; }

.delete-bin {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: #333;
    border: 2px solid #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 100;
    transition: bottom 0.3s ease, background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    pointer-events: none;
}

.delete-bin.active {
    bottom: 20px;
    pointer-events: auto;
}

.delete-bin.drag-over {
    background: #DC143C;
    transform: translateX(-50%) scale(1.1);
    border-color: #ff0000;
}

.delete-bin.drag-over .bin-icon { color: white; }

.bin-icon {
    color: #aaa;
    transition: color 0.2s ease;
}

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

.simulation-indicator {
    animation: pulse 1s infinite;
}

@media (max-width: 768px) {
    body { font-size: 14px; }

    .patient-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .patient-data {
        text-align: left;
        margin: 5px 0;
    }

    .patient-data strong { font-size: 12px; }
    .patient-data span { font-size: 16px; }

    .nav-container { flex-direction: column; }
    
    .nav-tab {
        border-right: none;
        border-bottom: 1px solid #444;
    }
    
    .page { height: calc(100vh - 180px); }
}