* {
    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;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

/* Color Picker Styles */
.color-picker {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.color-picker label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.color-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.color-option.active {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
    transform: scale(1.1);
}

.color-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color1);
}

.color-option::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color2);
}

.color-option:hover::before,
.color-option:hover::after {
    filter: brightness(1.1);
}

/* Range Toggle Button Styles */
.range-toggle {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.btn-toggle {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-toggle:active {
    transform: translateY(0);
}

.btn-toggle.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toggle-icon {
    font-size: 16px;
}

.toggle-text {
    font-size: 14px;
}

h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

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

.input-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    margin-bottom: 25px;
    align-items: start;
}

.input-group {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.helper-text {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

.btn-primary {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.charts-container {
    margin-top: 40px;
}

.chart-wrapper {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.chart-wrapper h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

.chart-stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-stat-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.chart-stat-item.highlight .chart-stat-label {
    color: white;
    font-weight: 700;
}

.chart-stat-item.highlight .chart-stat-value {
    color: white;
    font-size: 1.6rem;
}

.chart-stat-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.chart-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
}

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

.stats-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.stats-card h3 {
    color: #444;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.stat-label {
    font-weight: 500;
    color: #555;
}

.stat-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.comparison-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.comparison-card h3 {
    color: white;
    border-bottom-color: white;
}

.conclusion {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    color: #333;
    line-height: 1.8;
}

.conclusion p {
    margin-bottom: 10px;
}

.conclusion strong {
    color: #667eea;
}

.low-variance {
    color: #28a745;
    font-weight: bold;
}

.medium-variance {
    color: #ffc107;
    font-weight: bold;
}

.high-variance {
    color: #dc3545;
    font-weight: bold;
}

/* Custom Color Modal Styles */
.color-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.color-modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.color-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e0e0e0;
}

.color-modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.4rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-radius: 50%;
    line-height: 1;
}

.close-modal:hover {
    color: #333;
    background: #f0f0f0;
}

.color-modal-body {
    padding: 30px 25px;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.color-picker-row:last-child {
    margin-bottom: 0;
}

.color-picker-row label {
    font-weight: 600;
    color: #444;
    min-width: 130px;
    font-size: 15px;
}

.color-picker-row input[type="color"] {
    width: 70px;
    height: 45px;
    border: 3px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.color-picker-row input[type="color"]:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.color-picker-row span {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 15px;
    font-weight: 600;
    min-width: 80px;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 6px;
}

.color-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 2px solid #e0e0e0;
    justify-content: flex-end;
}

.btn-apply, .btn-cancel {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-apply:active, .btn-cancel:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .input-group {
        margin-bottom: 15px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }
}
