* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: white;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.explanation {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.visualization {
    flex: 2;
    min-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffcc00;
    border-bottom: 2px solid #ffcc00;
    padding-bottom: 8px;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #ffcc00;
}

p {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.1rem;
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    padding: 12px 25px;
    background: #ffcc00;
    color: #1a2a6c;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
    background: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(1px);
}

.material-type, .semiconductor-type {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.type-btn {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    flex: 1;
    margin: 0 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.type-btn.active {
    background: rgba(255, 204, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
    border-color: #ffcc00;
}

.type-btn h3 {
    margin-bottom: 5px;
    color: #ffcc00;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.info-message {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 204, 0, 0.9);
    color: #1a2a6c;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-message.show {
    opacity: 1;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    
    .visualization, .explanation {
        min-width: 100%;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .material-type, .semiconductor-type {
        flex-direction: column;
        gap: 10px;
    }
    
    .type-btn {
        margin: 5px 0;
    }
}