:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #94a3b8;
    --background: #f8fafc;
    --card-bg: #ffffff;
}

body {
    background: var(--background);
}

.main-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.title {
    font-weight: 700;
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.description {
    color: #64748b;
    font-size: 1.1rem;
}

.password-input-group:focus-within {
    border-color: var(--primary);
}

#password-field:focus {
    box-shadow: none;
}

.btn-refresh {
    background: #ffffff;
    border: none;
    padding: 0 1.25rem;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: #ffffff;
}

.btn-option {
    border: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    margin: 0 0.25rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.btn-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.length-control {
    background: #f1f5f9;
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.length-control-btn {
    border: none;
    width: 40px;
    font-size: 1.25rem;
    color: var(--primary);
    background: transparent;
}

#length {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

.strength-badge {
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-weight: 600;
    background: var(--primary-hover);
    color: white;
}

.advanced-settings {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.advanced-settings:hover {
    color: var(--primary-hover);
}

.form-check-label {
    color: #475569;
}

.footer {
    color: #64748b;
    margin-top: 3rem;
}

#password-field {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    padding: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.05em;
}

.password-input-group {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.3s ease;
    align-items: center;
}

/* Slider Styles */
.length-control {
    position: relative;
    padding: 1rem 0;
    width: 100%;
}

.form-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slider-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* New Layout Stability Styles */
.settings-container {
    min-height: 160px;
    position: relative;
    transition: min-height 0.3s ease;
}

.custom-hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: all 0.3s ease;
}

.advanced-settings-visible {
    opacity: 1;
    height: auto;
    visibility: visible;
}

.invisible-toggle {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Animations */
@keyframes fadeUpdate {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes pulse-update {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.password-update {
    animation: pulse-update 0.3s ease;
}

/* Enhanced Slider Styles */
.elegant-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    transition: all 0.3s ease;
}

.elegant-slider:hover {
    background: #cbd5e1;
}

.elegant-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid white;
}

.elegant-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid white;
}

/* Disabled States */
.elegant-slider:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.elegant-slider:disabled::-webkit-slider-thumb {
    background: #94a3b8;
    box-shadow: none;
}

.elegant-slider:disabled::-moz-range-thumb {
    background: #94a3b8;
    box-shadow: none;
}

/* Button Enhancements */
.password-input-group .btn-refresh {
    padding: 0 1rem;
    border-left: 1px solid #e2e8f0;
    background: #f1f5f9;
    transition: all 0.3s ease;
}

.password-input-group .btn-refresh:hover {
    background: #e2e8f0;
}

.password-input-group .d-flex {
    gap: 0.5rem;
}