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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 600;
}

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

main {
    padding: 30px;
}

/* Mohs Scale Section */
.mohs-scale-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mohs-scale-section h2 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 600;
}

.scale-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#mohsCanvas {
    width: 100%;
    height: 550px;
    display: block;
}

.scale-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4a90d9;
}

.scale-info p {
    color: #495057;
    line-height: 1.6;
}

/* Scratch Test Section */
.scratch-test-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scratch-test-section h2 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 600;
}

.test-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.test-visualization {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#scratchCanvas {
    width: 100%;
    height: 250px;
    display: block;
    border-radius: 8px;
    background: linear-gradient(180deg, #e8f4f8 0%, #d4e9f7 100%);
}

.test-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    display: none;
}

.test-result.show {
    display: block;
}

.test-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-result.failure {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.test-controls {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.test-controls h3 {
    color: #2d5a87;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.material-selection {
    margin-bottom: 20px;
}

.material-pair {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.material-selector {
    flex: 1;
}

.material-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e3a5f;
    font-size: 0.9em;
}

.material-selector select {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.material-selector select:hover {
    border-color: #4a90d9;
}

.material-selector select:focus {
    outline: none;
    border-color: #4a90d9;
}

.vs-symbol {
    font-weight: bold;
    font-size: 1.2em;
    color: #2d5a87;
    padding: 0 10px;
}

.test-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.test-button:active {
    transform: translateY(0);
}

.test-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4a90d9;
}

.test-info h3 {
    color: #1e3a5f;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.comparison-display {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 15px;
}

.hardness-value {
    text-align: center;
}

.hardness-value span:first-child {
    display: block;
    font-size: 0.9em;
    color: #495057;
    margin-bottom: 5px;
}

.hardness-value span:last-child {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #2d5a87;
}

.comparison-operator {
    font-size: 2.5em;
    font-weight: bold;
    color: #4a90d9;
}

.test-conclusion {
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    background: white;
    border: 2px solid #dee2e6;
}

/* Common Materials Section */
.common-materials-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.common-materials-section h2 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 600;
}

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

.material-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.material-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 10px;
}

.material-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #1e3a5f;
    text-align: center;
    margin-bottom: 8px;
}

.material-hardness {
    font-size: 2em;
    font-weight: bold;
    color: #4a90d9;
    text-align: center;
    margin-bottom: 10px;
}

.material-desc {
    font-size: 0.95em;
    color: #495057;
    text-align: center;
    line-height: 1.5;
}

/* Applications Section */
.applications-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.applications-section h2 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 600;
}

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

.application-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4a90d9;
}

.application-card h3 {
    color: #2d5a87;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.application-card p {
    color: #495057;
    line-height: 1.6;
}

/* Methods Section */
.methods-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.methods-section h2 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 600;
}

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

.method-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #764ba2;
}

.method-item h3 {
    color: #2d5a87;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.method-item p {
    color: #495057;
    line-height: 1.6;
}

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

.explanation h2 {
    color: #1e3a5f;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

.explanation h3 {
    color: #2d5a87;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.explanation p {
    line-height: 1.8;
    color: #495057;
    margin-bottom: 15px;
}

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

/* Responsive Design */
@media (max-width: 968px) {
    .test-layout {
        grid-template-columns: 1fr;
    }

    .material-pair {
        flex-direction: column;
    }

    .vs-symbol {
        padding: 10px 0;
    }

    .materials-grid,
    .applications-grid,
    .methods-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    main {
        padding: 15px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .comparison-display {
        flex-direction: column;
        gap: 15px;
    }
}