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

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

.color-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, #00d4ff 0%, #ff00ff 50%, #ffff00 100%);
    color: white;
    padding: 30px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

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

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 300;
}

main {
    padding: 30px;
}

.simulation-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.mixing-panel, .preview-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mixing-panel canvas, .preview-panel canvas {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: white;
    border: 2px solid #ddd;
}

.color-info {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    font-size: 0.95em;
}

.info-item span:first-child {
    font-weight: 600;
}

.info-item span:last-child {
    font-weight: 700;
    font-size: 1.2em;
}

.color-values {
    margin-top: 20px;
}

.color-values h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.value-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.value-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.value-label {
    display: block;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.value-number {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
}

.rgb-values {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.rgb-values h4 {
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: 600;
}

.rgb-display {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 5px;
}

.hex-display {
    font-size: 1em;
    font-weight: 600;
    color: #666;
    font-family: 'Courier New', monospace;
}

.controls-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.controls-panel h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

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

.control-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ddd;
}

.control-group.cyan {
    border-left-color: #00ffff;
}

.control-group.magenta {
    border-left-color: #ff00ff;
}

.control-group.yellow {
    border-left-color: #ffff00;
}

.control-group.black {
    border-left-color: #000000;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

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

.control-group.cyan input[type="range"] {
    background: linear-gradient(to right, #e0e0e0, #00ffff);
}

.control-group.magenta input[type="range"] {
    background: linear-gradient(to right, #e0e0e0, #ff00ff);
}

.control-group.yellow input[type="range"] {
    background: linear-gradient(to right, #e0e0e0, #ffff00);
}

.control-group.black input[type="range"] {
    background: linear-gradient(to right, #e0e0e0, #000000);
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid #666;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid #666;
}

.color-preview {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-top: 10px;
}

.cyan-preview {
    background: #00ffff;
}

.magenta-preview {
    background: #ff00ff;
}

.yellow-preview {
    background: #ffff00;
}

.black-preview {
    background: #000000;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.control-button {
    flex: 1;
    min-width: 120px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.control-button.reset {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.control-button.preset {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

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

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

.mixing-info {
    margin-top: 20px;
}

.mixing-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.combination-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.combination-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.combination-color {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.combination-text {
    flex: 1;
}

.combination-text strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.95em;
}

.combination-text span {
    font-size: 0.85em;
    color: #666;
}

.explanation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.explanation h3 {
    color: #764ba2;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 600;
}

.explanation p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
    font-size: 1.05em;
}

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

.comparison-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-item.subtractive {
    border-top: 4px solid #ff00ff;
}

.comparison-item.additive {
    border-top: 4px solid #00ffff;
}

.comparison-item h4 {
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.comparison-item ul {
    list-style: none;
    padding: 0;
}

.comparison-item li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
}

.comparison-item li:last-child {
    border-bottom: none;
}

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

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

.application-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.application-item h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.application-item p {
    line-height: 1.6;
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

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

    header h1 {
        font-size: 2em;
    }

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

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

    .control-button {
        width: 100%;
    }

    .value-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    main {
        padding: 15px;
    }

    .explanation {
        padding: 20px;
    }

    .explanation h2 {
        font-size: 1.4em;
    }

    .explanation h3 {
        font-size: 1.2em;
    }

    .value-list {
        grid-template-columns: 1fr;
    }
}