/* Strong Password Generator - Security & Modern Aesthetic */

/* Tab Navigation */
.tab-button {
    background: rgba(255, 255, 255, 0.6);
    color: #6b7280;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.tab-button.active::before {
    display: none;
}

/* Security-themed animations */
@keyframes security-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

@keyframes lock-unlock {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes shield-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(34, 197, 94, 0.6));
    }
}

/* Animated backgrounds */
.bg-gradient-security {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Enhanced slider styling */
.slider {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e5e7eb 0%, #e5e7eb 100%);
    outline: none;
    border-radius: 12px;
    position: relative;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    animation: security-pulse 2s infinite;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Password display enhancements */
#password-display {
    font-family: "Courier New", "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px solid #e2e8f0;
    position: relative;
    transition: all 0.3s ease;
}

#password-display:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

#password-display::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: 300% 300%;
    animation: gradient-shift 3s ease infinite;
}

#password-display:focus::before {
    opacity: 1;
}

/* Strength meter animations */
.strength-meter {
    position: relative;
    overflow: hidden;
}

.strength-meter::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: strength-shine 2s infinite;
}

@keyframes strength-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Checkbox and form enhancements */
input[type="checkbox"]:checked {
    animation: checkbox-bounce 0.3s ease;
}

@keyframes checkbox-bounce {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Button hover effects */
button:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

#generate-btn:hover {
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    animation: lock-unlock 0.5s ease;
}

#copy-password:hover {
    animation: security-pulse 1s infinite;
}

/* Results panel styling */
.password-result-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

/* Analysis results animations */
.analysis-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.5s ease forwards;
}

.analysis-item:nth-child(1) {
    animation-delay: 0.1s;
}
.analysis-item:nth-child(2) {
    animation-delay: 0.2s;
}
.analysis-item:nth-child(3) {
    animation-delay: 0.3s;
}
.analysis-item:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Security status indicators */
.security-check-passed {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    animation: shield-glow 2s ease-in-out infinite alternate;
}

.security-check-failed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: warning-flash 2s ease-in-out infinite alternate;
}

@keyframes warning-flash {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    }
}

/* Batch results styling */
.batch-password-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.batch-password-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.batch-password-item:hover::before {
    left: 100%;
}

.batch-password-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Breach check results */
.breach-status-safe {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #22c55e;
    position: relative;
}

.breach-status-danger {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-color: #ef4444;
    position: relative;
}

.breach-status-safe::before,
.breach-status-danger::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-size: 20px 20px;
    background-image: radial-gradient(circle at 10px 10px, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
}

/* Loading overlay enhancements */
#loading-overlay {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.5);
}

#loading-overlay .bg-white {
    animation: loading-bounce 1s ease-in-out infinite;
}

@keyframes loading-bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Toast notifications */
.toast {
    animation: toast-slide-in 0.3s ease-out;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .tab-button {
        padding: 12px 8px;
        font-size: 12px;
    }

    .tab-button svg {
        width: 16px;
        height: 16px;
    }

    #password-display {
        font-size: 14px;
        padding: 12px;
        min-height: 50px;
    }

    .strength-meter {
        height: 8px;
    }

    .analysis-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tab-button {
        padding: 8px 4px;
        font-size: 10px;
    }

    .tab-button .inline-block {
        display: none;
    }
}

/* Dark theme adaptations (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for now as per requirements */
    /* This section is prepared for future dark theme implementation */
}

/* Performance optimizations */
* {
    will-change: auto;
}

.tab-content {
    contain: layout style paint;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Copy button success state */
.copy-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    animation: copy-success-pulse 0.5s ease;
}

@keyframes copy-success-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Password strength color variations */
.strength-very-weak {
    color: #dc2626;
}
.strength-weak {
    color: #ea580c;
}
.strength-moderate {
    color: #ca8a04;
}
.strength-strong {
    color: #16a34a;
}
.strength-very-strong {
    color: #059669;
}

/* Entropy visualization */
.entropy-bar {
    background: linear-gradient(90deg, #dc2626, #ea580c, #ca8a04, #16a34a, #059669);
    height: 4px;
    border-radius: 2px;
    position: relative;
}

.entropy-indicator {
    position: absolute;
    top: -2px;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
}

/* Advanced form styling */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.2s ease;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    transform: translateY(-20px) scale(0.8);
    color: #3b82f6;
}

/* Glassmorphism effects */
.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Security level indicators */
.security-level-1 {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}
.security-level-2 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}
.security-level-3 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}
.security-level-4 {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}
.security-level-5 {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
