:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --text-color: #e0e0e0;
    --accent-color: #00ccff;
    --border-color: #333;
    --disabled-color: #555;
    --warning-color: #ff6b35;
    --success-color: #00ff88;
    --font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --glow-color: rgba(0, 204, 255, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--primary-bg) 0%, #1a1a2e 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

#app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

header {
    width: 100%;
    padding: 20px 0;
    text-align: center;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
    background: linear-gradient(45deg, var(--accent-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--glow-color);
}

#simulation-container {
    width: 100%;
    height: 75vh;
    max-height: 75vh;
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 2px solid var(--border-color);
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

#xray-canvas {
    background-color: #000;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: crosshair;
    border-radius: 8px;
    box-shadow: 
        0 0 30px rgba(0, 204, 255, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
    display: block;
}

#xray-canvas:hover {
    box-shadow: 
        0 0 40px rgba(0, 204, 255, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#initial-message {
    position: absolute;
    color: var(--text-color);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 300;
    padding: 30px;
    background: rgba(26, 26, 46, 0.9);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 20;
    pointer-events: none;
}

#demo-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, var(--success-color), var(--accent-color));
    color: #000;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    display: none;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(26, 26, 46, 0.95);
    padding: 15px 25px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
    justify-content: center;
    z-index: 30;
}

.control-button {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(45deg, var(--accent-color), #0099cc);
    color: #000;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 204, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.control-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.control-button:hover::before {
    left: 100%;
}

.control-button:hover {
    background: linear-gradient(45deg, #00ccff, #00aadd);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 204, 255, 0.5);
}

.control-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 204, 255, 0.3);
}

.control-button.off {
    background: linear-gradient(45deg, var(--disabled-color), #666);
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(85, 85, 85, 0.3);
}

.control-button.off:hover {
    background: linear-gradient(45deg, #666, #777);
    transform: translateY(-1px);
}

#info-content {
    width: 100%;
    max-width: 1000px;
    padding: 30px;
    box-sizing: border-box;
    background: rgba(26, 26, 46, 0.8);
    margin: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

h1, h2 {
    background: linear-gradient(45deg, var(--accent-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

h1 { 
    text-align: center; 
    font-size: 2.5rem;
    font-weight: 300;
}

h2 {
    font-size: 1.8rem;
    font-weight: 400;
}

p, ul {
    margin-bottom: 1.5em;
    font-size: 1.1rem;
    line-height: 1.8;
}

code {
    background: linear-gradient(45deg, var(--secondary-bg), #2a2a3e);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

li {
    margin-bottom: 0.8em;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    #simulation-container {
        height: 60vh;
    }
    
    #controls {
        bottom: 10px;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .control-button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    #info-content {
        padding: 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    #controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-button {
        width: 100%;
        margin: 2px 0;
    }
}

/* Loading animation */
.loading {
    animation: loading-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes loading-pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Debug info styling */
.debug-info {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ffff00;
    z-index: 100;
    text-shadow: 1px 1px 2px black;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    max-width: 300px;
    white-space: pre-line;
    line-height: 1.3;
}

/* Skeleton visibility enhancement */
#xray-canvas {
    filter: contrast(1.2) brightness(1.1);
}

/* Bone info tooltip styling */
.bone-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #ffff00;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    font-size: 14px;
    font-family: var(--font-family);
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
