/* Passione Calabria - Stili Personalizzati */

/* Variabili CSS personalizzate */
:root {
    --calabria-blue: #2563eb;
    --calabria-blue-light: #3b82f6;
    --calabria-blue-dark: #1d4ed8;
    --calabria-gold: #f59e0b;
    --calabria-gold-light: #fbbf24;
    --calabria-gold-dark: #d97706;
    --calabria-teal: #14b8a6;
    --calabria-green: #10b981;
}

/* Reset e base */
* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Utilità personalizzate */
.bg-calabria-gradient {
    background: linear-gradient(135deg, var(--calabria-blue) 0%, var(--calabria-teal) 50%, var(--calabria-gold) 100%);
}

.text-calabria-gradient {
    background: linear-gradient(135deg, var(--calabria-blue), var(--calabria-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse-slow 3s infinite;
}

/* Hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--calabria-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--calabria-blue-dark);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--calabria-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form styling */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors;
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

.btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg font-semibold transition-colors;
}

.btn-secondary {
    @apply bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-3 rounded-lg font-semibold transition-colors;
}

.btn-outline {
    @apply border-2 border-blue-600 text-blue-600 hover:bg-blue-600 hover:text-white px-6 py-3 rounded-lg font-semibold transition-colors;
}

/* Card components */
.article-card {
    @apply bg-white rounded-2xl shadow-lg overflow-hidden transition-all duration-300 hover:shadow-2xl;
}

.category-card {
    @apply bg-white rounded-2xl shadow-lg overflow-hidden hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-2;
}

.province-card {
    @apply bg-white rounded-2xl shadow-lg overflow-hidden hover:shadow-2xl transition-all duration-300;
}

/* Badge styles */
.badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-medium;
}

.badge-primary {
    @apply bg-blue-100 text-blue-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

/* Alert styles */
.alert {
    @apply p-4 rounded-lg mb-4;
}

.alert-info {
    @apply bg-blue-50 border border-blue-200 text-blue-800;
}

.alert-success {
    @apply bg-green-50 border border-green-200 text-green-800;
}

.alert-warning {
    @apply bg-yellow-50 border border-yellow-200 text-yellow-800;
}

.alert-danger {
    @apply bg-red-50 border border-red-200 text-red-800;
}

/* Navigation styles */
.nav-link {
    @apply text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium transition-colors;
}

.nav-link.active {
    @apply text-blue-600 bg-blue-50;
}

/* Breadcrumb */
.breadcrumb {
    @apply flex items-center space-x-2 text-sm text-gray-600;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    @apply ml-2 text-gray-400;
}

/* Table styles */
.table {
    @apply w-full text-left border-collapse;
}

.table th {
    @apply bg-gray-50 px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider border-b border-gray-200;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap border-b border-gray-200;
}

.table tbody tr:hover {
    @apply bg-gray-50;
}

/* Pagination */
.pagination {
    @apply flex items-center justify-center space-x-2;
}

.pagination-item {
    @apply px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50 rounded-md transition-colors;
}

.pagination-item.active {
    @apply bg-blue-600 text-white border-blue-600;
}

.pagination-item:disabled {
    @apply opacity-50 cursor-not-allowed;
}

/* Modal styles */
.modal-overlay {
    @apply fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50;
}

.modal {
    @apply bg-white rounded-lg shadow-xl max-w-md w-full p-6;
}

/* Dropdown styles */
.dropdown {
    @apply relative inline-block;
}

.dropdown-menu {
    @apply absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 border border-gray-200 z-10;
}

.dropdown-item {
    @apply block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors;
}

/* Progress bar */
.progress {
    @apply w-full bg-gray-200 rounded-full h-2;
}

.progress-bar {
    @apply bg-blue-600 h-full rounded-full transition-all duration-300;
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }

    .mobile-full {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .bg-calabria-gradient {
        background: white !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.focus-visible:focus {
    outline: 2px solid var(--calabria-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card-hover:hover {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-fade-in-up,
    .animate-slide-in-left,
    .animate-pulse-slow {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        @apply bg-gray-900 text-white;
    }

    .auto-dark .card-hover {
        @apply bg-gray-800;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--calabria-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Tooltip styles */
.tooltip {
    @apply absolute z-50 px-2 py-1 text-sm text-white bg-gray-900 rounded shadow-lg pointer-events-none;
}

/* Skeleton loading */
.skeleton {
    @apply bg-gray-200 animate-pulse rounded;
}

.skeleton-text {
    @apply h-4 bg-gray-200 animate-pulse rounded;
}

.skeleton-avatar {
    @apply w-10 h-10 bg-gray-200 animate-pulse rounded-full;
}

/* Interactive elements */
.interactive {
    @apply cursor-pointer transition-all duration-200 transform hover:scale-105 active:scale-95;
}

/* Floating elements */
.floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Image overlay */
.image-overlay {
    @apply absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent;
}

/* Text gradient */
.text-gradient-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom scrollable areas */
.scrollable {
    scrollbar-width: thin;
    scrollbar-color: var(--calabria-blue) transparent;
}

.scrollable::-webkit-scrollbar {
    width: 6px;
}

.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
    background: var(--calabria-blue);
    border-radius: 3px;
}

/* Aspect ratios */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-photo {
    aspect-ratio: 4 / 3;
}

/* Content styling */
.prose {
    @apply text-gray-700 leading-relaxed;
}

.prose h1 {
    @apply text-3xl font-bold text-gray-900 mb-6;
}

.prose h2 {
    @apply text-2xl font-bold text-gray-900 mb-4 mt-8;
}

.prose h3 {
    @apply text-xl font-semibold text-gray-900 mb-3 mt-6;
}

.prose p {
    @apply mb-4;
}

.prose ul {
    @apply list-disc list-inside mb-4 space-y-2;
}

.prose ol {
    @apply list-decimal list-inside mb-4 space-y-2;
}

.prose a {
    @apply text-blue-600 hover:text-blue-700 underline;
}

.prose blockquote {
    @apply border-l-4 border-blue-500 pl-4 italic text-gray-600 my-6;
}

.prose code {
    @apply bg-gray-100 px-2 py-1 rounded text-sm font-mono;
}

.prose pre {
    @apply bg-gray-900 text-white p-4 rounded-lg overflow-x-auto my-6;
}

.prose img {
    @apply rounded-lg shadow-md my-6;
}

.prose table {
    @apply w-full border-collapse border border-gray-300 my-6;
}

.prose th,
.prose td {
    @apply border border-gray-300 px-4 py-2;
}

.prose th {
    @apply bg-gray-50 font-semibold;
}


/* Language Flags Styling */
.language-flag {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
}

.language-flag:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.language-flag.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Header Improvements */
.header-gradient {
    background: linear-gradient(135deg, 
        #1e3a8a 0%,     /* blue-900 */
        #1e40af 25%,    /* blue-800 */ 
        #3b82f6 50%,    /* blue-500 */
        #f59e0b 75%,    /* amber-500 */
        #d97706 100%    /* amber-600 */
    );
}

/* Mobile Language Selector */
@media (max-width: 768px) {
    .language-flag {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}



/* Marker Mappa Colorati */
.custom-colored-marker {
    background: none !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.custom-colored-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s ease-out;
}

.custom-colored-marker:hover svg {
    transform: scale(1.2);
}
