/* ============================================
   GeneratorZaParoli.bg v1 — Professional Glassmorphism
   Password Generator Theme
   Light & Dark theme support
   ============================================ */

/* ============================================
   FONT: Onest (local)
   ============================================ */
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Onest-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/Onest-Medium.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Onest-SemiBold.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/Onest-Bold.ttf') format('truetype');
}
@font-face {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/Onest-ExtraBold.ttf') format('truetype');
}

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
    /* Glass cards */
    --card-outer-bg: rgba(255, 255, 255, 0.35);
    --card-outer-border: rgba(255, 255, 255, 0.5);
    --card-outer-hover-shadow: rgba(0, 0, 0, 0.06);
    --card-inner-bg: #fff;
    --card-inner-dot: rgba(0, 0, 0, 0.035);

    /* Blobs */
    --blob-one-from: #6ee7b7;
    --blob-one-to: #34d399;
    --blob-two-from: #93c5fd;
    --blob-two-to: #60a5fa;
    --blob-three-from: #a5b4fc;
    --blob-three-to: #818cf8;
    --blob-four-from: #99f6e4;
    --blob-four-to: #5eead4;

    /* Copied button */
    --share-copied-bg: #ecfdf5;
    --share-copied-color: #059669;
    --share-copied-border: #a7f3d0;

    /* Spinner */
    --spinner-track: rgba(148, 163, 184, 0.2);
    --spinner-color: #64748b;

    /* Scrollbar */
    --scrollbar-thumb: #e2e8f0;
    --scrollbar-thumb-hover: #cbd5e1;

    /* Selection */
    --selection-bg: rgba(16, 185, 129, 0.2);
    --selection-color: #1e293b;

    /* Password colors */
    --pw-letter: #334155;
    --pw-digit: #2563eb;
    --pw-symbol: #d97706;
    --pw-bg: #f8fafc;
    --pw-border: #e2e8f0;
    --pw-hover-border: #cbd5e1;

    /* Strength colors */
    --strength-0: #ef4444;
    --strength-1: #f97316;
    --strength-2: #eab308;
    --strength-3: #22c55e;
    --strength-4: #059669;
}

.dark {
    --card-outer-bg: rgba(30, 41, 59, 0.45);
    --card-outer-border: rgba(71, 85, 105, 0.35);
    --card-outer-hover-shadow: rgba(0, 0, 0, 0.3);
    --card-inner-bg: #1e293b;
    --card-inner-dot: rgba(255, 255, 255, 0.03);

    --blob-one-from: #064e3b;
    --blob-one-to: #065f46;
    --blob-two-from: #1e3a5f;
    --blob-two-to: #1e40af;
    --blob-three-from: #312e81;
    --blob-three-to: #3730a3;
    --blob-four-from: #134e4a;
    --blob-four-to: #115e59;

    --share-copied-bg: rgba(16, 185, 129, 0.15);
    --share-copied-color: #34d399;
    --share-copied-border: rgba(52, 211, 153, 0.3);

    --spinner-track: rgba(100, 116, 139, 0.2);
    --spinner-color: #94a3b8;

    --scrollbar-thumb: #475569;
    --scrollbar-thumb-hover: #64748b;

    --selection-bg: rgba(52, 211, 153, 0.3);
    --selection-color: #f1f5f9;

    --pw-letter: #e2e8f0;
    --pw-digit: #60a5fa;
    --pw-symbol: #fbbf24;
    --pw-bg: #0f172a;
    --pw-border: #334155;
    --pw-hover-border: #475569;

    --strength-0: #ef4444;
    --strength-1: #f97316;
    --strength-2: #eab308;
    --strength-3: #4ade80;
    --strength-4: #34d399;
}

/* Theme transition */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

html { scroll-behavior: smooth; }

/* ============================================
   BACKGROUND BLOBS
   ============================================ */
.blob-bg { pointer-events: none; }

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    will-change: transform, border-radius;
}

.blob--one {
    width: 650px;
    height: 650px;
    top: -120px;
    left: -120px;
    background: radial-gradient(circle at 40% 40%, var(--blob-one-from), var(--blob-one-to));
    animation: morph-1 20s ease-in-out infinite alternate;
}

.blob--two {
    width: 550px;
    height: 550px;
    top: 80px;
    right: -100px;
    background: radial-gradient(circle at 60% 35%, var(--blob-two-from), var(--blob-two-to));
    opacity: 0.35;
    animation: morph-2 24s ease-in-out infinite alternate;
}

.blob--three {
    width: 500px;
    height: 500px;
    top: 600px;
    left: -60px;
    background: radial-gradient(circle at 45% 55%, var(--blob-three-from), var(--blob-three-to));
    opacity: 0.3;
    animation: morph-3 18s ease-in-out infinite alternate;
}

.blob--four {
    width: 480px;
    height: 480px;
    top: 1100px;
    right: -80px;
    background: radial-gradient(circle at 50% 50%, var(--blob-four-from), var(--blob-four-to));
    opacity: 0.4;
    animation: morph-4 22s ease-in-out infinite alternate;
}

@keyframes morph-1 {
    0%   { border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; transform: translate(0,0) rotate(0deg) scale(1); }
    50%  { border-radius: 55% 45% 35% 65% / 45% 55% 50% 50%; transform: translate(40px,-30px) rotate(90deg) scale(1.03); }
    100% { border-radius: 35% 65% 55% 45% / 55% 35% 65% 45%; transform: translate(-20px,20px) rotate(180deg) scale(0.98); }
}

@keyframes morph-2 {
    0%   { border-radius: 50% 50% 40% 60% / 40% 60% 40% 60%; transform: translate(0,0) rotate(0deg); }
    50%  { border-radius: 35% 65% 60% 40% / 55% 45% 55% 45%; transform: translate(-30px,40px) rotate(90deg); }
    100% { border-radius: 60% 40% 50% 50% / 45% 55% 45% 55%; transform: translate(20px,-20px) rotate(180deg); }
}

@keyframes morph-3 {
    0%   { border-radius: 45% 55% 50% 50% / 60% 40% 60% 40%; transform: translate(0,0) rotate(0deg) scale(1); }
    50%  { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; transform: translate(-40px,-25px) rotate(-90deg) scale(1.05); }
    100% { border-radius: 40% 60% 55% 45% / 50% 50% 40% 60%; transform: translate(25px,30px) rotate(-180deg) scale(0.97); }
}

@keyframes morph-4 {
    0%   { border-radius: 55% 45% 45% 55% / 50% 50% 50% 50%; transform: translate(0,0) rotate(0deg); }
    50%  { border-radius: 40% 60% 55% 45% / 60% 40% 55% 45%; transform: translate(35px,-40px) rotate(60deg); }
    100% { border-radius: 45% 55% 60% 40% / 55% 45% 40% 60%; transform: translate(-15px,15px) rotate(120deg); }
}

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none !important; }
    .section-animate { opacity: 1 !important; transform: none !important; }
}

/* ============================================
   GLASS CARDS
   ============================================ */
.glass-card-outer {
    background: var(--card-outer-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-outer-border);
    border-radius: 22px;
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-card-outer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--card-outer-hover-shadow);
}
.glass-card-inner {
    background: var(--card-inner-bg);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.glass-card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--card-inner-dot) 1px, transparent 1px);
    background-size: 14px 14px;
    pointer-events: none;
}

/* Generator card specifics */
.glass-card-outer:has(.relative.z-\\[1\\] > .flex.flex-col.lg\\:flex-row) {
    padding: 16px;
}
@media (min-width: 640px) {
    .glass-card-outer:has(.relative.z-\\[1\\] > .flex.flex-col.lg\\:flex-row) {
        padding: 18px;
    }
    .glass-card-outer:has(.relative.z-\\[1\\] > .flex.flex-col.lg\\:flex-row) .glass-card-inner {
        padding: 28px;
    }
}

/* ============================================
   RANGE SLIDER
   ============================================ */
.password-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #059669 0%, #059669 var(--slider-pct, 15%), #e2e8f0 var(--slider-pct, 15%), #e2e8f0 100%);
    outline: none;
    cursor: pointer;
    transition: background 0.1s;
}
.dark .password-slider {
    background: linear-gradient(to right, #34d399 0%, #34d399 var(--slider-pct, 15%), #334155 var(--slider-pct, 15%), #334155 100%);
}
.password-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #059669;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dark .password-slider::-webkit-slider-thumb {
    background: #34d399;
    border-color: #1e293b;
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.4);
}
.password-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
}
.password-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #059669;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
    cursor: pointer;
}
.dark .password-slider::-moz-range-thumb {
    background: #34d399;
    border-color: #1e293b;
}
.password-slider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: transparent;
}

/* ============================================
   CHECKBOX STYLING
   ============================================ */
.pw-checkbox.active {
    border-color: rgba(5, 150, 105, 0.4);
    background: rgba(16, 185, 129, 0.05);
}
.dark .pw-checkbox.active {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.05);
}

/* ============================================
   PASSWORD LIST ITEMS
   ============================================ */
.pw-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--pw-bg);
    border: 1px solid var(--pw-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    animation: slideInPw 0.3s ease-out forwards;
    opacity: 0;
}
.pw-item:hover {
    border-color: var(--pw-hover-border);
}

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

.pw-text {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.pw-char-letter { color: var(--pw-letter); }
.pw-char-digit { color: var(--pw-digit); font-weight: 700; }
.pw-char-symbol { color: var(--pw-symbol); font-weight: 700; }

.pw-strength-mini {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    overflow: hidden;
    flex-shrink: 0;
}
.dark .pw-strength-mini {
    background: #334155;
}
.pw-strength-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.pw-copy-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--pw-border);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pw-copy-btn:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: var(--pw-hover-border);
}
.dark .pw-copy-btn:hover {
    background: #334155;
    color: #cbd5e1;
}
.pw-copy-btn.copied {
    background: var(--share-copied-bg) !important;
    color: var(--share-copied-color) !important;
    border-color: var(--share-copied-border) !important;
}

.copy-all-btn.copied {
    background: var(--share-copied-bg) !important;
    color: var(--share-copied-color) !important;
    border-color: var(--share-copied-border) !important;
}

/* ============================================
   SLOT MACHINE ANIMATION
   ============================================ */
@keyframes slotSpin {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}
.pw-spinning .pw-text {
    animation: slotSpin 0.08s linear infinite;
}

/* ============================================
   GENERATE BUTTON
   ============================================ */
.generate-btn {
    position: relative;
    overflow: hidden;
}
.generate-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
}
.generate-btn.ripple::after {
    opacity: 1;
    animation: rippleFade 0.6s ease-out forwards;
}
@keyframes rippleFade {
    from { opacity: 1; transform: scale(0); }
    to { opacity: 0; transform: scale(2.5); }
}

/* ============================================
   STRENGTH METER
   ============================================ */
.strength-segment.active-0 { background: var(--strength-0) !important; }
.strength-segment.active-1 { background: var(--strength-1) !important; }
.strength-segment.active-2 { background: var(--strength-2) !important; }
.strength-segment.active-3 { background: var(--strength-3) !important; }
.strength-segment.active-4 { background: var(--strength-4) !important; }

/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.faq-item.open .faq-content {
    max-height: 300px;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}
.faq-toggle {
    cursor: pointer;
    background: none;
    border: none;
}
.faq-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}
.dark .faq-toggle:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   RATING STARS
   ============================================ */
.stars__star.active {
    color: #f59e0b !important;
    transform: scale(1.15);
}
.stars__star.hovered {
    color: #fbbf24 !important;
}

/* ============================================
   SECTION ANIMATIONS (IntersectionObserver)
   ============================================ */
.section-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

::selection { background: var(--selection-bg); color: var(--selection-color); }

/* ============================================
   STRENGTH TOGGLE VISIBILITY
   ============================================ */
/* Strength toggle eye icons — using JS now, CSS selectors unreliable with adjacent sibling + button */

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .blob { filter: blur(70px); opacity: 0.35; }
    .blob--one { width: 400px; height: 400px; }
    .blob--two { width: 350px; height: 350px; }
    .blob--three { width: 320px; height: 320px; }
    .blob--four { width: 300px; height: 300px; }

    .pw-item {
        padding: 8px 10px;
        gap: 6px;
    }
    .pw-text {
        font-size: 12px;
        letter-spacing: 0.3px;
    }
    .pw-strength-mini {
        width: 40px;
    }
    .pw-copy-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .pw-strength-mini {
        display: none;
    }
}
