/* Scoped styles for the Password Generator App */

:root {
    --pw-bg: rgba(17, 24, 39, 0.7);
    --pw-primary: #8b5cf6;
    --pw-primary-hover: #7c3aed;
    --pw-border: rgba(255, 255, 255, 0.1);
}

.app-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.main-card {
    background: var(--pw-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--pw-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    min-height: 500px;
    margin-top: 2rem;
}

/* Common Section Styles */
.input-section,
.display-section {
    padding: 3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Left Section */
.input-section {
    border-right: 1px solid var(--pw-border);
}

.brand {
    margin-bottom: 2rem;
}

.brand h1 {
    font-size: 2.2rem;
    font-weight: 600;
    background: linear-gradient(to right, #a78bfa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.brand p {
    color: #94a3b8;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group > label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pw-primary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pw-primary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Checkboxes */
.checkbox-group {
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--pw-primary);
    border-color: var(--pw-primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* Number Input */
input[type="number"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--pw-border);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

input[type="number"]:focus {
    border-color: var(--pw-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Generate Button */
#generate-btn {
    background: linear-gradient(135deg, var(--pw-primary), var(--pw-primary-hover));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#generate-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

#generate-btn:active {
    transform: translateY(0);
}

/* Right Section */
.display-section {
    align-items: center;
    background: rgba(15, 23, 42, 0.3);
    position: relative;
    overflow-y: auto;
}

.placeholder {
    text-align: center;
    color: #94a3b8;
}

#result-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.result-header label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--pw-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* Password List */
#password-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.password-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--pw-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
}

.password-text {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #f8fafc;
    word-break: break-all;
    line-height: 1.4;
}

.copy-single-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: color 0.2s ease;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.copy-single-btn:hover {
    color: var(--pw-primary);
}

/* Strength Indicator */
.strength-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.strength-weak .strength-bar-fill { width: 25%; background: #ef4444; }
.strength-weak .strength-label { color: #ef4444; }

.strength-medium .strength-bar-fill { width: 50%; background: #f59e0b; }
.strength-medium .strength-label { color: #f59e0b; }

.strength-strong .strength-bar-fill { width: 75%; background: #22c55e; }
.strength-strong .strength-label { color: #22c55e; }

.strength-very-strong .strength-bar-fill { width: 100%; background: #06b6d4; }
.strength-very-strong .strength-label { color: #06b6d4; }

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .main-card {
        flex-direction: column;
        height: auto;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--pw-border);
        padding: 2rem;
    }

    .display-section {
        padding: 2rem;
        min-height: 300px;
    }

    .brand h1 {
        font-size: 1.8rem;
    }
}
