/* Custom styles for Password QR Generator */

/* Smooth transitions for all elements */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Custom range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    margin: 0;
    padding: 0;
    height: 32px;
}

/* Track sottile e centrata */
input[type="range"]::-webkit-slider-runnable-track {
    background: #d1d5db;
    height: 7px;
    border-radius: 4px;
    margin-top: 15px;
}
.dark input[type="range"]::-webkit-slider-runnable-track {
    background: #d1d5db;
}

input[type="range"]::-ms-fill-lower,
input[type="range"]::-ms-fill-upper {
    background: #d1d5db;
    height: 2px;
    border-radius: 1px;
}
.dark input[type="range"]::-ms-fill-lower,
.dark input[type="range"]::-ms-fill-upper {
    background: #3b4252;
}

input[type="range"]::-moz-range-track {
    background: #d1d5db;
    height: 2px;
    border-radius: 1px;
}
.dark input[type="range"]::-moz-range-track {
    background: #3b4252;
}

/* Rimuovo ogni ombra/bordo extra */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3b82f6;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(59,130,246,0.15);
    border: 2px solid #fff;
    margin-top: -8px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

input[type="range"]:focus::-webkit-slider-thumb {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Firefox */
input[type="range"]::-moz-range-track {
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
}

.dark input[type="range"]::-moz-range-track {
    background: #232a36 !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
}

input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(59,130,246,0.15);
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

input[type="range"]:focus::-moz-range-thumb {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* IE/Edge */
input[type="range"]::-ms-thumb {
    background: #3b82f6;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(59,130,246,0.15);
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-ms-tooltip {
    display: none;
}

/* Rimuovo eventuali pseudo-elementi di background */
input[type="range"]::-webkit-slider-container,
input[type="range"]::-webkit-slider-thumb:before,
input[type="range"]::-webkit-slider-thumb:after {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Card background in dark mode */
.dark .bg-white {
    background: #232a36 !important;
}
.dark .bg-gray-100 {
    background: #23272f !important;
}
/* End custom range slider */

/* Custom checkbox styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.dark input[type="checkbox"] {
    border-color: #6b7280;
    background: #374151;
}

input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

input[type="checkbox"]:hover {
    border-color: #3b82f6;
}

/* Button hover effects */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* Card hover effects */
.bg-white, .dark .bg-gray-800 {
    transition: all 0.3s ease;
}

.bg-white:hover, .dark .bg-gray-800:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* QR container animations */
.qr-container {
    transition: all 0.3s ease;
}

.qr-container:hover {
    transform: scale(1.02);
}

/* Password strength bar animation */
.password-strength {
    transition: all 0.5s ease;
}

/* Toast animations */
#toast {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Loading animation for generate button */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Pulse animation for success states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Gradient text animation */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-gradient-to-r {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    .qr-container img {
        width: 150px !important;
        height: 150px !important;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bg-white, .dark .bg-gray-800 {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    button, #themeToggle {
        display: none !important;
    }
    
    .qr-container {
        border: 1px solid #ccc !important;
        background: white !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background: white !important;
    }
    
    .dark .bg-gray-900 {
        background: black !important;
    }
    
    .text-gray-600 {
        color: #333 !important;
    }
    
    .dark .text-gray-400 {
        color: #ccc !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    button:hover {
        transform: none;
    }
    
    .qr-container:hover {
        transform: none;
    }
} 