:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --text-color: #2d334a;
    --light-color: #f7fff7;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px dashed var(--accent-color);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.formula-container {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.formula {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.math-formula {
    font-size: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    display: inline-block;
}

.formula-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 0.7rem;
    border-radius: 6px;
}

.symbol {
    font-weight: 600;
    margin-right: 0.7rem;
    color: var(--primary-color);
    font-size: 1.2rem;
    min-width: 30px;
}

.description {
    font-size: 0.9rem;
}

.calculator {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.range-container, .input-container {
    display: flex;
    align-items: center;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.slider::-moz-range-thumb:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.range-value {
    margin-left: 1rem;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
    font-weight: 500;
}

.range-description {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

.text-input {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    width: 100px;
    transition: border-color 0.3s;
    text-align: center;
}

.text-input:focus {
    border-color: var(--secondary-color);
}

.input-suffix {
    margin-left: 0.7rem;
    color: var(--text-color);
    opacity: 0.8;
}

.button-container {
    text-align: center;
    margin-top: 2rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

button:hover {
    background-color: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.4);
}

button:active {
    transform: translateY(0);
}

.result-container {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
    display: none;
}

.rating-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.5rem 0;
}

.rating-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.rating-label {
    font-size: 1.5rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.5rem;
}

.rating-interpretation {
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    margin: 0 auto;
    max-width: 80%;
    margin-bottom: 2rem;
}

.joke-scale-container {
    margin-top: 2rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 1.5rem;
}

.joke-scale-container h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.joke-scale {
    margin: 1.5rem 0;
}

.scale-bar {
    height: 20px;
    background: linear-gradient(to right, #4ecdc4, #ffe66d, #ff6b6b, #ff4757, #6c5ce7);
    border-radius: 10px;
    position: relative;
    margin-bottom: 10px;
}

.scale-marker {
    width: 30px;
    height: 30px;
    background-color: white;
    border: 3px solid var(--text-color);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: 0;
    transform: translateX(-50%);
    transition: left 0.5s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-color);
    padding: 0 5px;
}

.joke-comparison {
    margin-top: 2rem;
    text-align: center;
}

.comparison-title {
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.example-joke {
    font-size: 1.1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    font-style: italic;
}

.example-joke:before {
    content: '"';
    font-size: 2rem;
    color: var(--primary-color);
    position: absolute;
    left: 10px;
    top: 0;
}

.example-joke:after {
    content: '"';
    font-size: 2rem;
    color: var(--primary-color);
    position: absolute;
    right: 10px;
    bottom: 0;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .formula-container, .calculator, .result-container {
        padding: 1.5rem;
    }
    
    .formula-legend {
        grid-template-columns: 1fr;
    }
    
    .rating-value {
        font-size: 3.5rem;
    }
}
