* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f3f2ef;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #1d1d1f;
}

.container {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    width: 100%;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0a66c2;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 1rem;
    text-align: center;
}

.controls {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

label {
    display: block;
    margin-bottom: 44px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Slider track */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    outline: none;
    position: relative;
}

/* WebKit thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #0a66c2;
    border-radius: 50%;
    cursor: pointer;
}

/* Firefox thumb */
input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #0a66c2;
    border-radius: 50%;
    cursor: pointer;
}

/* Floating indicator above thumb */
.range-indicator {
    position: absolute;
    top: -36px;
    width: 32px;
    height: 32px;
    background: #0a66c2;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: left 0.05s ease;
}

.controls button {
    display: block;
    margin: 20px auto 0 auto;
    background: #0a66c2;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.controls button:hover {
    background: #004182;
}

.result {
    margin-top: 25px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-role {
    background: #eef3f8;
    color: #0a66c2;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    animation: fadeIn 0.4s ease-in;
}

.placeholder {
    color: #999;
    font-style: italic;
    font-size: 0.95rem;
    text-align: center;
}

.history {
    margin-top: 30px;
}

.history h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: left;
}

.history-list {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    max-height: 180px;
    overflow-y: auto;
}

.history-item {
    padding: 6px 0;
    border-bottom: 1px solid #e6e6e6;
    color: #444;
    font-size: 0.95rem;
}

.history-item:last-child {
    border-bottom: none;
}

.clear-history {
    background: #d11124;
    font-size: 0.85rem;
    padding: 6px 14px;
    margin-top: 10px;
    border-radius: 18px;
}

.clear-history:hover {
    background: #a50e1b;
}

.role-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #eef3f8;
    padding: 15px 20px;
    border-radius: 10px;
    animation: fadeIn 0.4s ease-in;
}

.copy-button {
    background: #0a66c2;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background: #004182;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(10, 102, 194, 0.3);
}

.copy-button.copied {
    background: #057642;
}

.copy-button.copied::after {
    content: "Copied!";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #057642;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    animation: fadeInOut 1.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .generated-role {
        font-size: 1.1rem;
        padding: 12px;
    }
}
