/* 
 * Custom CSS - Sistema Gestionale Permessi
 * Questo file contiene stili personalizzati aggiuntivi
 * Tailwind CSS è già incluso via CDN
 */

/* Animazioni custom */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Applicazione animazioni */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse-slow {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Shadow effects */
.shadow-soft {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Badge styles enhancement */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Card hover effects */
.card-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-interactive:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Form input focus glow */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Calendar day cells */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.calendar-day:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 9999px;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Table row hover */
tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* 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.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .glass, .backdrop-blur-lg {
        background: white !important;
        backdrop-filter: none !important;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-full {
        width: 100% !important;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
}

.permessi-top-nav-icon {
    display: none;
    width: 18px;
    height: 18px;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.permessi-top-nav-user-label {
    display: none;
}

@media (min-width: 768px) and (max-width: 1180px) {
    .permessi-top-nav {
        gap: 0.25rem;
    }

    .permessi-top-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 72px;
        padding: 0.45rem 0.3rem;
        border-radius: 0.75rem;
        font-size: 10px;
        line-height: 1.05;
    }

    .permessi-top-nav-icon {
        display: block;
    }

    .permessi-top-nav-label {
        white-space: normal;
        text-align: center;
        max-width: 74px;
    }

    .permessi-top-nav-user-btn {
        min-width: 66px;
        gap: 0.15rem;
    }

    .permessi-top-nav-user-name {
        display: none;
    }

    .permessi-top-nav-user-label {
        display: block;
        white-space: normal;
        text-align: center;
        max-width: 66px;
    }

    .permessi-top-nav-user-btn img,
    .permessi-top-nav-user-btn > div {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Accessibility */
.focus-visible:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Dark mode support (opzionale) */
@media (prefers-color-scheme: dark) {
    /* Se si vuole implementare dark mode */
}
