/**
 * SafeVault - Stili Personalizzati
 *
 * Questo file contiene stili aggiuntivi per migliorare l'interfaccia utente.
 * Tailwind CSS viene usato per la maggior parte dello styling, mentre questo
 * file contiene solo personalizzazioni specifiche.
 */

/* Reset e impostazioni base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animazioni personalizzate */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Applica animazione fade-in agli elementi principali */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Stile per le card */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Input focus personalizzati */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Stile per i pulsanti con effetto hover */
button,
.btn {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

button:active,
.btn:active {
    transform: scale(0.98);
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

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

/* Stile per il modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* Animazione per il modal */
.modal-enter {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideIn 0.3s ease;
}

/* Tabelle responsive */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem !important;
    }
}

/* Badge per forza password */
.password-strength-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.password-strength-weak {
    background-color: #fee;
    color: #c00;
}

.password-strength-medium {
    background-color: #ffa;
    color: #880;
}

.password-strength-strong {
    background-color: #efe;
    color: #060;
}

/* Effetto hover per le righe della tabella */
tbody tr {
    transition: background-color 0.2s ease;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4f46e5;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notification personalizzata */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 200px;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

/* Print styles - nasconde elementi non necessari in stampa */
@media print {
    header,
    button,
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
    }

    table {
        page-break-inside: avoid;
    }
}

/* Accessibilità - focus visibile per tastiera */
*:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Effetti per link */
a {
    transition: color 0.2s ease;
}

/* Gradient background animato (opzionale) */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Stile per code/pre (usato nella pagina about) */
code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    color: #1f2937;
}

/* Utility classes personalizzate */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive improvements */
@media (max-width: 640px) {
    .responsive-text {
        font-size: 0.875rem;
    }

    .responsive-padding {
        padding: 0.5rem;
    }
}

/* Dark mode support (opzionale per future implementazioni) */
@media (prefers-color-scheme: dark) {
    /*
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    */
}

/* Prevenzione selezione su elementi UI */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Container per icone con animazione hover */
.icon-hover {
    transition: transform 0.2s ease;
}

.icon-hover:hover {
    transform: scale(1.1);
}

/* Effetto ripple per i pulsanti (opzionale) */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}
