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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f8;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Tab styling */
.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 4px;
}

.tab-btn:hover {
    color: #2c3e50;
    background-color: #f5f5f5;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
}

.tab-content {
    display: none;
}

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

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    color: #2c3e50;
    margin: 20px 0 15px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.control-group {
    margin-bottom: 15px;
    flex-basis: 32%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
}

select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.sample-type-btns {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.sample-type-btn {
    flex: 1;
    padding: 6px 0;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sample-type-btn:hover {
    background-color: #e0e0e0;
}

.sample-type-btn:active {
    background-color: #d0d0d0;
    transform: scale(0.98);
}

.control-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: #2980b9;
}

.control-btn:active {
    transform: scale(0.98);
}

.reset-camera-btn {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: block;
    width: 100%;
    margin-top: 10px;
}

.reset-camera-btn:hover {
    background-color: #c0392b;
}

.reset-camera-btn:active {
    transform: scale(0.98);
}

.hint {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 6px;
}

.visualization {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

canvas {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 3D containers */
#particle-3d-container,
#stress-3d-container {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

/* Ensure 3D canvases inherit styling from the container */
#particle-3d-container canvas,
#stress-3d-container canvas {
    border: none;
    margin-bottom: 0;
    border-radius: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.threejs-container {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.threejs-container canvas {
    border: none;
    margin-bottom: 0;
    border-radius: 0;
    display: block;
}

.data-display {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 15px;
    background-color: #f0f3f7;
    border-radius: 8px;
}

.data-item {
    text-align: center;
}

.data-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.data-value {
    font-size: 1.2em;
    color: #16a085;
}

.explanation {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.explanation p, 
.explanation ul {
    margin-bottom: 15px;
}

.explanation ul {
    padding-left: 20px;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
    }
    
    .data-display {
        flex-direction: column;
    }
    
    .data-item {
        margin-bottom: 10px;
    }
}