/* ============================================
   PASSWORD GENERATOR - STYLES
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg: #faf9f7;
    --bg-elevated: #ffffff;
    --card: #ffffff;
    --border: #e5e3df;
    --border-hover: #d4d1cb;
    --fg: #1a1817;
    --muted: #6b6560;
    --accent: #8b5cf6;
    --accent-light: rgba(139, 92, 246, 0.15);
    --accent-glow: rgba(139, 92, 246, 0.2);
    --secondary: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --input-bg: #ffffff;
    --pattern-opacity: 0.3;
}

[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-elevated: #12121a;
    --card: #16161f;
    --border: #2a2a3a;
    --border-hover: #3a3a4a;
    --fg: #e8e8ed;
    --muted: #6b6b7a;
    --accent: #a78bfa;
    --accent-light: rgba(167, 139, 250, 0.15);
    --accent-glow: rgba(167, 139, 250, 0.2);
    --secondary: #3b82f6;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --input-bg: #0f0f14;
    --pattern-opacity: 0.05;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ============================================
   BACKGROUND DECORATION
   ============================================ */

.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--muted) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: var(--pattern-opacity);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
    top: -150px;
    right: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #bfdbfe, #93c5fd);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

[data-theme="dark"] .orb-1 {
    background: var(--accent);
    opacity: 0.15;
}

[data-theme="dark"] .orb-2 {
    background: var(--secondary);
    opacity: 0.15;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.05); }
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent);
    background: var(--accent-light);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--fg);
    fill: none;
    stroke-width: 2;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease forwards;
}

.header-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: var(--accent-light);
}

.header-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ============================================
   PANEL
   ============================================ */

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.panel:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* ============================================
   PASSWORD DISPLAY
   ============================================ */

.password-display {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

.password-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ============================================
   STRENGTH INDICATOR
   ============================================ */

.strength-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.strength-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.strength-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
}

.strength-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.3s ease;
}

.strength-segment.weak {
    background: var(--danger);
}

.strength-segment.medium {
    background: var(--warning);
}

.strength-segment.strong {
    background: var(--success);
}

/* ============================================
   SLIDER
   ============================================ */

.slider-container {
    margin: 1.5rem 0;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.slider-value {
    color: var(--accent);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-glow);
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

/* ============================================
   OPTIONS
   ============================================ */

.options-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--fg);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: var(--accent);
}

.option-item.active {
    background: var(--accent-light);
    border-color: var(--accent);
}

.option-item.active .option-label {
    color: var(--accent);
}

.option-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.option-item.active .option-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.option-checkbox svg {
    width: 14px;
    height: 14px;
    stroke: white;
    fill: none;
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.option-item.active .option-checkbox svg {
    opacity: 1;
}

.option-label {
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.option-hint {
    font-size: 0.75rem;
    color: var(--muted);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-primary {
    flex: 2;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-secondary {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-secondary.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* ============================================
   TOAST
   ============================================ */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card);
    border: 1px solid var(--success);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast svg {
    width: 20px;
    height: 20px;
    stroke: var(--success);
    fill: none;
    stroke-width: 2.5;
}

/* ============================================
   FADE IN ANIMATION
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
    }
    
    .password-value {
        font-size: 1rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
}
