/* Subtle animations for modern UX */

/* Card hover animations */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Button animations */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.6s ease-in-out, background-color 0.3s ease-in-out;
}

/* Input focus animations */
.form-control:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease-in-out;
}

/* Password generation animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.password-generated {
    animation: slideIn 0.4s ease-out;
}

/* Copy button success animation */
@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.btn-success {
    animation: bounce 0.3s ease-in-out;
}

/* Feature icon pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.feature-icon:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Navbar collapse smooth animation */
.navbar-collapse {
    transition: height 0.35s ease;
}

/* Alert fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: fadeIn 0.5s ease-out;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Dark mode optimizations */
[data-bs-theme="dark"] .card {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .card:hover {
    background-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .alert-info {
    --bs-alert-color: #9ec5fe;
    --bs-alert-bg: #052c65;
    --bs-alert-border-color: #0a4078;
}

[data-bs-theme="dark"] .text-muted {
    color: var(--bs-gray-400) !important;
}

[data-bs-theme="dark"] .feature-icon {
    box-shadow: 0 0 0 0.125rem rgba(255, 255, 255, 0.1);
}

/* Ensure good contrast for progress bars in dark mode */
[data-bs-theme="dark"] .progress {
    background-color: var(--bs-gray-700);
}

/* Better visibility for form controls in dark mode */
[data-bs-theme="dark"] .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Responsive design improvements */
@media (max-width: 768px) {
    /* Smaller feature icons on mobile */
    .feature-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
    }
    
    /* Adjust card padding on mobile */
    .card-body {
        padding: 1.5rem !important;
    }
    
    /* Smaller titles on mobile */
    .display-5 {
        font-size: 2rem !important;
    }
    
    /* Better spacing for password requirements */
    .alert .row {
        text-align: center !important;
    }
    
    .alert .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    /* Stack buttons vertically on very small screens */
    .btn-lg.ms-2 {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* Even smaller adjustments for very small screens */
    .px-4.py-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Make password input and toggle button stack better */
    .input-group .btn {
        min-width: 60px;
    }
    
    /* Adjust generated password display for mobile */
    .font-monospace {
        font-size: 0.9rem;
        word-break: break-all;
    }
}

/* Improve accessibility for touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS recommended touch target size */
    }
    
    .card:hover {
        transform: none; /* Disable hover effects on touch devices */
    }
    
    .btn:hover {
        transform: none;
    }
}