/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* Animated gradient background */
.bg-gradient-animated {
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e, #0f3460);
    background-size: 400% 400%;
    animation: gradient-xy 15s ease infinite;
}

/* Glassmorphism effect helper */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(45deg, #10b981, #06b6d4, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Password display border animation - Flowing gradient effect */
.password-display-active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        90deg,
        #10b981 0%,
        #06b6d4 25%,
        #a855f7 50%,
        #06b6d4 75%,
        #10b981 100%
    );
    border-radius: 1rem;
    opacity: 0.6;
    z-index: -1;
    filter: blur(8px);
    animation: border-flow 4s ease-in-out infinite;
    background-size: 400% 100%;
    will-change: background-position;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .password-display-active::before {
        animation: none;
        background-size: 100% 100%;
        opacity: 0.4;
    }
}

/* Range slider custom styling */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #10b981 0%, #10b981 var(--value), rgba(255,255,255,0.1) var(--value), rgba(255,255,255,0.1) 100%);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: all 0.3s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    border: none;
    transition: all 0.3s ease;
}
input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}

/* Particle animation */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #10b981;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite linear;
}

/* Button ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Notification positioning */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}
.notification.show {
    transform: translateX(0);
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* History card delete animation */
.history-card.deleting {
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Custom Tooltip Styles */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid;
    border-image: linear-gradient(135deg,
        rgba(16, 185, 129, 0.5),
        rgba(6, 182, 212, 0.5),
        rgba(168, 85, 247, 0.5)
    ) 1;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(16, 185, 129, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(4px);
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep essential animations but make them instant */
    .bg-gradient-animated {
        animation: none;
    }

    /* Disable particle animations */
    #particles * {
        animation: none !important;
    }

    /* Make tooltips instant for reduced motion */
    [data-tooltip]::before,
    [data-tooltip]::after {
        transition: none !important;
    }
}

/* Print Stylesheet */
@media print {
    /* Hide unnecessary elements */
    #particles,
    .notification,
    button,
    input[type="range"],
    input[type="checkbox"],
    #alternativePasswords,
    #aiSuggestions,
    #breachCheck,
    .tab,
    #scrollIndicatorLeft,
    #scrollIndicatorRight {
        display: none !important;
    }

    /* Ensure content is visible */
    body {
        background: white !important;
        color: black !important;
    }

    /* Show passwords in clear text for printing */
    #password {
        color: black !important;
        font-size: 14pt;
    }

    /* Style history for printing */
    .glass {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    /* Make text readable */
    * {
        color: black !important;
        background: transparent !important;
    }

    /* Add page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    .history-card {
        page-break-inside: avoid;
        margin-bottom: 1cm;
    }

    /* Print header */
    @page {
        margin: 2cm;
    }

    /* Add print-only header */
    body::before {
        content: "UltraPass Pro - Password List";
        display: block;
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 1cm;
        text-align: center;
    }
}

/* Keyboard shortcut hint styling */
.kbd-hint {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-left: 8px;
}

/* ========== PREMIUM ENTERPRISE ENHANCEMENTS ========== */

/* Enhanced Button Hover - Lift Effect */
.btn-ripple,
button:not(.tab) {
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ripple:hover,
button:not(.tab):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4),
                0 4px 10px -2px rgba(0, 0, 0, 0.3);
}

.btn-ripple:active,
button:not(.tab):active {
    transform: translateY(0);
    transition: all 0.1s;
}

/* Glow on Hover for Primary Buttons */
.bg-gradient-to-r:hover {
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.6))
            drop-shadow(0 0 30px rgba(6, 182, 212, 0.4));
}

/* Card 3D Hover Depth */
.glass {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 20px 60px -10px rgba(16, 185, 129, 0.3),
        0 0 40px rgba(6, 182, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Copy Success Floating Animation */
@keyframes float-up-fade {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-15px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

.copy-success-floater {
    position: absolute;
    top: -10px;
    right: 10px;
    animation: float-up-fade 1s ease-out forwards;
    color: #10b981;
    font-weight: 700;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 2px 10px rgba(16, 185, 129, 0.5);
}

/* Success Pulse Animation */
@keyframes success-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.success-pulse {
    animation: success-pulse 0.6s ease-out;
}

/* Staggered List Animations */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#historyList > div:nth-child(1) { animation: slide-up 0.3s ease-out 0.05s both; }
#historyList > div:nth-child(2) { animation: slide-up 0.3s ease-out 0.1s both; }
#historyList > div:nth-child(3) { animation: slide-up 0.3s ease-out 0.15s both; }
#historyList > div:nth-child(4) { animation: slide-up 0.3s ease-out 0.2s both; }
#historyList > div:nth-child(5) { animation: slide-up 0.3s ease-out 0.25s both; }
#historyList > div:nth-child(6) { animation: slide-up 0.3s ease-out 0.3s both; }
#historyList > div:nth-child(7) { animation: slide-up 0.3s ease-out 0.35s both; }
#historyList > div:nth-child(8) { animation: slide-up 0.3s ease-out 0.4s both; }
#historyList > div:nth-child(9) { animation: slide-up 0.3s ease-out 0.45s both; }
#historyList > div:nth-child(10) { animation: slide-up 0.3s ease-out 0.5s both; }

/* Enhanced Focus Indicators */
*:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 4px;
    border-radius: 8px;
    transition: outline 0.2s ease, box-shadow 0.2s ease;
}

button:focus-visible {
    outline: 3px solid #10b981;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.2);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15),
                inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Gradient Border Effect */
.gradient-border-card {
    position: relative;
    background-clip: padding-box;
}

.gradient-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        #10b981 0%,
        #06b6d4 50%,
        #a855f7 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box,
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border-card:hover::before {
    opacity: 1;
}

/* Loading Skeleton Animations */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 0%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Typography Refinements */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-rendering: optimizeLegibility;
}

.text-balance {
    text-wrap: balance;
}

/* Hardware Acceleration */
.hw-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

.glass,
.btn-ripple,
#passwordDisplay,
.particle {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Enhanced Option Toggle Animation */
.option-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-item.active {
    animation: check-bounce 0.4s ease-out;
}

@keyframes check-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Enhanced Tab Hover */
.tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.tab.active {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4),
                0 0 40px rgba(16, 185, 129, 0.2);
}

/* Password Display Enhancement */
#passwordDisplay {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#passwordDisplay:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
}

/* Notification Enhancement */
.notification {
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Empty State Float Animation */
@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-icon {
    animation: float-gentle 3s ease-in-out infinite;
}

/* Progress Bar Glow */
.strength-bar {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease;
}

.strength-strong {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6),
                0 0 40px rgba(16, 185, 129, 0.3);
}

.strength-medium {
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.6),
                0 0 30px rgba(234, 179, 8, 0.3);
}

.strength-weak {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6),
                0 0 20px rgba(239, 68, 68, 0.3);
}

/* Light theme (2 Oct 2026), applied as html.light by the page's own toggle (storage key password-generator-theme,
   shared with the FAQ and help pages). The original dark look stays the default. These rules are unlayered, so
   they win over the Tailwind utilities (which live in a cascade layer) whatever the specificity. */
html.light body.bg-black { background-color: #eef2f7; color: #0f172a; }
html.light .bg-gradient-animated { background: linear-gradient(135deg, #f1f5f9, #e0f2f1, #e0f2fe, #ede9fe); background-size: 400% 400%; }
html.light .particle { opacity: 0.35; }
html.light .glass { background: rgba(255, 255, 255, 0.72); }
html.light .glass:hover { box-shadow: 0 20px 60px -10px rgba(16, 185, 129, 0.2), 0 0 40px rgba(6, 182, 212, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
html.light .text-white { color: #0f172a; }
html.light .bg-gradient-to-r.text-white, html.light .bg-gradient-to-br.text-white, html.light .focus\:text-white:focus { color: #fff; }
html.light .hover\:text-white:hover { color: #0f172a; }
html.light .text-gray-300 { color: #334155; }
html.light .text-gray-400 { color: #475569; }
html.light .text-gray-500 { color: #64748b; }
html.light .placeholder-gray-500::placeholder { color: #94a3b8; }
html.light .bg-black\/40 { background-color: rgba(255, 255, 255, 0.6); }
html.light .bg-black\/80 { background-color: rgba(255, 255, 255, 0.92); }
html.light .bg-white\/5 { background-color: rgba(15, 23, 42, 0.04); }
html.light .bg-white\/10 { background-color: rgba(15, 23, 42, 0.08); }
html.light .hover\:bg-white\/10:hover { background-color: rgba(15, 23, 42, 0.08); }
html.light .border-white\/10 { border-color: rgba(15, 23, 42, 0.12); }
html.light .border-white\/20 { border-color: rgba(15, 23, 42, 0.2); }
html.light .from-black { --tw-gradient-from: #eef2f7; }
html.light .to-black { --tw-gradient-to: #eef2f7; }
html.light .from-gray-900 { --tw-gradient-from: #e2e8f0; }
html.light .focus\:ring-offset-black:focus { --tw-ring-offset-color: #eef2f7; }
html.light .kbd-hint { background: rgba(15, 23, 42, 0.06); border-color: rgba(15, 23, 42, 0.15); }
html.light .tab:not(.active) { background: rgba(15, 23, 42, 0.04); }
html.light .tab:not(.active):hover { background: rgba(15, 23, 42, 0.08); color: #0f172a; }
html.light .tab:not(:last-child)::after { background: rgba(15, 23, 42, 0.15); }
html.light .skeleton { background: linear-gradient(90deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.12) 50%, rgba(15, 23, 42, 0.05) 100%); background-size: 1000px 100%; }
html.light ::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.08); }
html.light .notification { box-shadow: 0 10px 40px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(16, 185, 129, 0.3); }
html.light input[type="range"] { background: linear-gradient(to right, #10b981 0%, #10b981 var(--value), rgba(15, 23, 42, 0.12) var(--value), rgba(15, 23, 42, 0.12) 100%); }
html.light .text-primary-300 { color: #047857; }
html.light .text-secondary-300 { color: #0e7490; }
html.light .text-accent-300 { color: #7e22ce; }
html.light .text-green-300 { color: #15803d; }
html.light .text-red-300 { color: #b91c1c; }
html.light .text-purple-300 { color: #7e22ce; }
html.light .text-orange-300 { color: #c2410c; }
html.light .text-indigo-300 { color: #4338ca; }
html.light .text-blue-300 { color: #1d4ed8; }
html.light .text-primary-400 { color: #059669; }
html.light .text-secondary-400 { color: #0e7490; }
html.light .text-accent-400 { color: #9333ea; }
html.light .text-green-400 { color: #15803d; }
html.light .text-red-400 { color: #b91c1c; }
html.light .text-purple-400 { color: #9333ea; }
html.light .text-pink-400 { color: #db2777; }
html.light .text-blue-400 { color: #2563eb; }
html.light .text-yellow-400 { color: #a16207; }
html.light .group:hover .group-hover\:text-primary-400 { color: #059669; }
html.light .group:hover .group-hover\:text-secondary-400 { color: #0e7490; }
html.light .group:hover .group-hover\:text-accent-400 { color: #9333ea; }
html.light .group:hover .group-hover\:text-green-400 { color: #15803d; }
html.light .group:hover .group-hover\:text-red-400 { color: #b91c1c; }
html.light .group:hover .group-hover\:text-purple-400 { color: #9333ea; }
html.light .group:hover .group-hover\:text-pink-400 { color: #db2777; }
html.light .group:hover .group-hover\:text-blue-400 { color: #2563eb; }
html.light .group:hover .group-hover\:text-yellow-400 { color: #a16207; }
html.light .hover\:text-primary-400:hover { color: #059669; }
html.light .hover\:text-secondary-400:hover { color: #0e7490; }
html.light .hover\:text-accent-400:hover { color: #9333ea; }
html.light .hover\:text-green-400:hover { color: #15803d; }
html.light .hover\:text-red-400:hover { color: #b91c1c; }
html.light .hover\:text-purple-400:hover { color: #9333ea; }
html.light .hover\:text-pink-400:hover { color: #db2777; }
html.light .hover\:text-blue-400:hover { color: #2563eb; }
html.light .hover\:text-yellow-400:hover { color: #a16207; }
html.light .hover\:text-primary-300:hover { color: #047857; }
html.light .hover\:text-secondary-300:hover { color: #0e7490; }
html.light .hover\:text-accent-300:hover { color: #7e22ce; }
html.light .hover\:text-green-300:hover { color: #15803d; }
html.light .hover\:text-red-300:hover { color: #b91c1c; }
html.light .hover\:text-purple-300:hover { color: #7e22ce; }
html.light .hover\:text-orange-300:hover { color: #c2410c; }
html.light .hover\:text-indigo-300:hover { color: #4338ca; }
html.light .hover\:text-blue-300:hover { color: #1d4ed8; }
html.light .text-primary-500, html.light .text-red-500 { color: inherit; }
html.light .text-primary-500 { color: #047857; } html.light .text-red-500 { color: #b91c1c; }
html.light .hover\:text-primary-200:hover { color: #065f46; }
