body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Navigation Menu Styles */
.nav-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
}

.nav-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 20px 40px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.nav-menu a.active {
    background: rgba(255,255,255,0.2);
    font-weight: bold;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* Main Content */
.main-content {
    padding: 40px;
}

.page-title {
    text-align: center;
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: bold;
}

.form-container {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

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

.form-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.form-group:hover {
    transform: translateY(-2px);
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1em;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input[type="number"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="number"]:valid {
    border-color: #28a745;
}

.button-container {
    text-align: center;
    margin-top: 30px;
}

.submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 50px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.result-container {
    margin-top: 40px;
    padding: 30px;
    border: 3px dashed;
    border-radius: 15px;
    text-align: center;
    display: none;
    animation: fadeIn 0.5s ease-in;
}

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

.result-container.cluster-0 {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.result-container.cluster-1 {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.result-container.cluster-2 {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-container h3 {
    color: #155724;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.result-container .result-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
    font-size: 1.1em;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

.parameter-groups {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 40px;
}

.parameter-group {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid;
}

.parameter-group.chemical {
    border-left-color: #3498db;
}

.parameter-group.organic {
    border-left-color: #2ecc71;
}

.parameter-group.pigment {
    border-left-color: #f39c12;
}

.group-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
}

.group-title::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.chemical .group-title {
    color: #3498db;
    border-bottom-color: #3498db;
}

.chemical .group-title::before {
    background: #3498db;
}

.organic .group-title {
    color: #2ecc71;
    border-bottom-color: #2ecc71;
}

.organic .group-title::before {
    background: #2ecc71;
}

.pigment .group-title {
    color: #f39c12;
    border-bottom-color: #f39c12;
}

.pigment .group-title::before {
    background: #f39c12;
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.group-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.group-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #e9ecef;
}

.group-item label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.95em;
    color: #2c3e50;
}

.group-item input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.group-item input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.group-item input:valid {
    border-color: #28a745;
}

.group-item input:invalid {
    border-color: #dc3545;
}

@media (max-width: 1024px) {
    .group-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .page-title {
        font-size: 2em;
    }
    
    .nav-menu a {
        padding: 15px 20px;
        font-size: 1em;
    }
    
    .parameter-groups {
        gap: 30px;
    }
    
    .parameter-group {
        padding: 20px;
    }
    
    .group-title {
        font-size: 1.3em;
    }
    
    .group-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .group-item {
        padding: 15px;
    }
    
    .group-item input {
        padding: 10px 12px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    
    .page-title {
        font-size: 1.8em;
    }
    
    .nav-menu a {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .parameter-group {
        padding: 15px;
    }
    
    .group-title {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .group-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .group-item {
        padding: 12px;
    }
    
    .group-item label {
        font-size: 0.9em;
    }
    
    .group-item input {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .submit-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }
}
