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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    min-height: 100vh;
    padding: 20px;
}

.solid-defects-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

/* Defect Selector */
.defect-selector {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.defect-selector h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.defect-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.defect-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.defect-btn:hover {
    border-color: #6366f1;
    background: #f5f3ff;
    transform: translateY(-2px);
}

.defect-btn.active {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border-color: #4f46e5;
}

/* Visualization Layout */
.visualization-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .visualization-layout {
        grid-template-columns: 1fr;
    }
}

.crystal-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.canvas-container h3 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

canvas {
    width: 100%;
    border-radius: 8px;
    background: white;
    display: block;
}

.canvas-info {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
    font-size: 0.9rem;
    color: #475569;
}

/* View Controls */
.view-controls {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.view-controls h4 {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.control-button {
    background: #6366f1;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.control-button:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.control-button.active {
    background: #4f46e5;
}

/* Information Panel */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.properties-display,
.formula-display,
.effects-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.properties-display h3,
.formula-display h3,
.effects-display h3 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.property-label {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.property-value {
    font-size: 1rem;
    color: #4f46e5;
    font-weight: 700;
}

.formula-content {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    padding: 15px;
}

.formula-main {
    font-size: 1.2rem;
    color: #92400e;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}

.formula-desc {
    font-size: 0.95rem;
    color: #78350f;
    text-align: center;
}

.effects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.effect-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.effect-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.effect-label {
    display: block;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 4px;
}

.effect-value {
    display: block;
    font-size: 0.85rem;
    color: #6366f1;
    font-weight: 700;
}

/* Controls Panel */
.controls-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.controls-panel h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.control-group h4 {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.range-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.info-text {
    font-size: 0.85rem;
    color: #0369a1;
}

.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    margin-bottom: 15px;
}

.control-group select:focus {
    outline: none;
    border-color: #6366f1;
}

.checkbox-input {
    width: auto !important;
    margin-right: 8px;
    cursor: pointer;
}

.preset-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 4px;
}

.preset-btn:hover {
    border-color: #6366f1;
    background: #f5f3ff;
    transform: translateY(-2px);
}

.control-button.reset {
    background: #ef4444;
}

.control-button.reset:hover {
    background: #dc2626;
}

/* Comparison Panel */
.comparison-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-panel h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.comparison-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.comparison-card h4 {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.comparison-card ul {
    list-style: none;
    margin-bottom: 15px;
}

.comparison-card li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: #475569;
    padding-left: 20px;
    position: relative;
}

.comparison-card li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6366f1;
    font-weight: bold;
}

.comparison-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
}

.comparison-info span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

/* Applications Panel */
.applications-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.applications-panel h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.application-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.application-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.application-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.application-card h4 {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.application-card p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}

/* Explanation Section */
.explanation {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    color: #1e293b;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid #e5e7eb;
}

.explanation h3 {
    color: #374151;
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.explanation p {
    color: #475569;
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 15px;
}

.explanation strong {
    color: #1e293b;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    main {
        padding: 20px;
    }

    .defect-options {
        grid-template-columns: 1fr 1fr;
    }

    .controls-grid,
    .comparison-grid,
    .applications-grid {
        grid-template-columns: 1fr;
    }

    .effects-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .control-button {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .solid-defects-container {
        box-shadow: none;
        border-radius: 0;
    }

    .controls-panel,
    .button-group {
        display: none;
    }
}
