/* News Article Generator - Stili CSS
   DomainHub.it */

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

:root {
    /* Colori principali */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Grigi */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
}

.logo {
    display: flex;
    transition: transform 0.2s ease;
    align-items: center;
    gap: var(--space-sm);
}
.logo:hover {
    transform: scale(1.02);
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.header-nav {
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
        background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Search Section */
.search-section {
    background: white;
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--gray-200);
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: var(--space-md);
    align-items: center;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input,
.select-input,
.text-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.search-input {
    padding-left: 2.5rem;
}

.search-input:focus,
.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8125rem;
}

/* Main Content */
.main-content {
    padding: var(--space-2xl) 0;
    min-height: calc(100vh - 200px);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto var(--space-lg);
    animation: spin 1s linear infinite;
}

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

/* Error State */
.error-state {
    text-align: center;
    padding: var(--space-2xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.error-state i {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: var(--space-md);
}

.error-state h3 {
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.news-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Badge per fonte */
.source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
}

.source-badge.newsapi {
    background: var(--primary-color);
}

.source-badge.newsapi-ai {
    background: var(--success-color);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-200);
}

.news-content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 0.75rem;
    color: var(--gray-500);
}

.news-category {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem var(--space-xs);
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-transform: uppercase;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: auto;
}

.news-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: 100px;
}

.page-info {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.news-preview-title {
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--gray-800);
}

/* Article Preview */
.article-preview {
    background: var(--gray-50);
    padding: var(--space-xl);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.article-preview h1 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
    line-height: 1.3;
}

.article-preview h2 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.article-preview h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.article-preview p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

.article-preview ul,
.article-preview ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-xl);
}

.article-preview li {
    margin-bottom: var(--space-xs);
}

/* Image placeholder per suggerimenti immagini */
.image-placeholder {
    background: var(--gray-200);
    border: 2px dashed var(--gray-400);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    margin: var(--space-lg) 0;
    text-align: center;
    color: var(--gray-600);
}

.image-placeholder i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: var(--space-sm);
    display: block;
}

.image-placeholder p {
    margin: 0;
    font-style: italic;
    font-size: 0.875rem;
}

/* SEO Analysis */
.seo-analysis {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.seo-score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto var(--space-lg);
}

.seo-score.excellent {
    background: var(--success-color);
    color: white;
}

.seo-score.good {
    background: var(--warning-color);
    color: white;
}

.seo-score.poor {
    background: var(--danger-color);
    color: white;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.keyword-tag {
    background: var(--gray-100);
    padding: 0.25rem var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-700);
}

.keyword-tag.primary {
    background: var(--primary-color);
    color: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

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

/* Responsive */
@media (max-width: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: var(--space-sm);
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}
/* Aggiungi questi stili al file style.css esistente */

/* Badge per fonte */
.source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.source-badge.newsapi {
    background: var(--primary-color);
}

.source-badge.newsapi-ai {
    background: var(--success-color);
}

/* Bordi colorati per le card */
.news-card.source-newsapi {
    border-left: 4px solid var(--primary-color);
}

.news-card.source-newsapi-ai {
    border-left: 4px solid var(--success-color);
}

/* Badge sentiment */
.sentiment-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sentiment-badge i {
    font-size: 0.8rem;
}

/* Hover effect differenziato */
.news-card.source-newsapi:hover {
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.2);
}

.news-card.source-newsapi-ai:hover {
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.2);
}

/* Responsive per badge */
@media (max-width: 768px) {
    .source-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    
    .sentiment-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}
/* Aggiungi al tuo style.css */

/* Indicatore conteggio fonti */
.source-counter {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.source-counter-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.source-counter-item.newsapi {
    border: 1px solid var(--primary-color);
}

.source-counter-item.newsapi-ai {
    border: 1px solid var(--success-color);
}

/* Evidenzia filtro attivo */
#sourceFilter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/* Loader Modal Styles */
#loaderModal {
    background: rgba(0, 0, 0, 0.8); /* Sfondo scuro semi-trasparente */
    backdrop-filter: blur(8px); /* Effetto blur per lo sfondo */
}

.loader-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
    margin: auto; /* Centra il contenuto */
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.loader-animation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: var(--space-2xl);
    text-align: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.loader-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto var(--space-lg);
    animation: spin 1s linear infinite;
}

.loader-progress {
    margin-top: var(--space-lg);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: white;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    color: white;
    font-weight: 600;
    margin-top: var(--space-sm);
    font-size: 1.25rem;
}

.loader-info {
    padding: var(--space-xl);
    background: white; /* Sfondo bianco esplicito */
}

.loader-info h3 {
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.loader-info > p {
    color: var(--gray-700); /* Colore più scuro per migliore leggibilità */
    text-align: center;
    margin-bottom: var(--space-lg);
    font-weight: 500;
}

.loader-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.stat-item {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.stat-item i {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--space-xs);
}

.stat-item strong {
    color: var(--gray-900);
    font-weight: 600;
}

.loader-steps {
    margin-bottom: var(--space-lg);
}

.loader-steps .step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    background: var(--gray-50); /* Sfondo di default */
    border: 1px solid var(--gray-200); /* Bordo per definizione */
    color: var(--gray-700); /* Testo più scuro */
    font-weight: 500;
}

.loader-steps .step i {
    width: 20px;
    text-align: center;
    color: var(--gray-500);
}

.loader-steps .step.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.loader-steps .step.active i {
    color: white;
}

.loader-steps .step.completed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.loader-steps .step.completed i {
    color: white;
}

.loader-tip {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-800); /* Testo più scuro */
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-weight: 500;
    box-shadow: 0 1px 3px 0 rgba(245, 158, 11, 0.1);
}

.loader-tip i {
    color: var(--warning-color);
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .loader-stats {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        text-align: left;
    }
    
    .stat-item i {
        font-size: 1.25rem;
        margin-bottom: 0;
    }
}
/* Aggiungi questi stili al tuo style.css */

/* Stile premium per articoli extra lunghi */
.premium-generation .loader-animation {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    position: relative;
    overflow: hidden;
}

.premium-generation .loader-animation::before {
    content: '✨ CLAUDE 4 OPUS ✨';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0.9;
}

.premium-generation .loader-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
    width: 100px;
    height: 100px;
    border-width: 5px;
}

.premium-generation .progress-fill {
    background: linear-gradient(90deg, #fbbf24, #ffffff, #fbbf24);
    background-size: 200% 100%;
    animation: goldShimmer 2s linear infinite;
}

@keyframes goldShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Badge per Claude 4 nel form */
.claude4-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

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

/* Indicatore di qualità per selezione lunghezza */
.length-quality-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.quality-stars {
    color: #fbbf24;
}

/* Tooltip informativo */
.model-tooltip {
    position: relative;
    display: inline-block;
}

.model-tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: var(--gray-900);
    color: white;
    text-align: left;
    padding: 12px;
    border-radius: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.model-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--gray-900) transparent transparent transparent;
}

.model-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Animazione speciale per step 2 con Claude 4 */
.premium-generation .step.active#step2 i {
    animation: spinPulse 1s linear infinite;
}

@keyframes spinPulse {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}
/* Banner informativo notizie */
.news-info-banner {
    background: var(--primary-color);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

.news-info-banner .info-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    justify-content: center;
}

.news-info-banner strong {
    font-weight: 600;
}

/* Indicatore età notizia */
.news-card .news-meta .age-indicator {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
}

.news-card .news-meta .age-indicator.fresh {
    background: var(--success-color);
    color: white;
}

.news-card.has-generated {
    opacity: 0.8;
    border: 2px solid var(--success-color);
}

.news-card.has-generated::after {
    content: 'Articolo Generato';
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}
/* Banner ricerca */
.search-info-banner {
    background: var(--warning-color);
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: none;
}

.search-info-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.search-info-content strong {
    font-weight: 600;
}

.search-info-banner .btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* Evidenzia campo ricerca quando attivo */
.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Animazione per ricerca in corso */
.searching .news-grid {
    opacity: 0.6;
    pointer-events: none;
}
.nav-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}
.nav-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--gray-900);
    z-index: 1000;
    pointer-events: none;
}

/* Badge per admin */
.header-nav span[style*="color: var(--primary-color)"] {
    font-weight: 600;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .header-nav span {
        display: none;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
}
        .admin-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: var(--space-xl) 0;
        }
        
        .admin-nav {
            background: white;
            border-bottom: 1px solid var(--gray-200);
            padding: var(--space-md) 0;
            margin-bottom: var(--space-xl);
        }
        
        .admin-nav-list {
            display: flex;
            gap: var(--space-lg);
            list-style: none;
        }
        
        .admin-nav-link {
            padding: var(--space-sm) var(--space-md);
            text-decoration: none;
            color: var(--gray-600);
            border-radius: var(--radius-md);
            transition: all 0.2s;
        }
        
        .admin-nav-link:hover,
        .admin-nav-link.active {
            background: var(--primary-color);
            color: white;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: var(--space-lg);
            margin-bottom: var(--space-2xl);
        }
        
        .stat-card {
            background: white;
            padding: var(--space-xl);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            text-align: center;
            border: 1px solid var(--gray-200);
        }
        
        .stat-icon {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto var(--space-md);
            font-size: 1.5rem;
            color: white;
        }
        
        .stat-icon.users { background: var(--primary-color); }
        .stat-icon.articles { background: var(--success-color); }
        .stat-icon.budget { background: var(--warning-color); }
        .stat-icon.activity { background: var(--danger-color); }
        
        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--gray-900);
            margin-bottom: var(--space-xs);
        }
        
        .stat-label {
            color: var(--gray-600);
            font-size: 0.875rem;
        }
        
        .stat-change {
            font-size: 0.75rem;
            margin-top: var(--space-xs);
        }
        
        .stat-change.positive { color: var(--success-color); }
        .stat-change.negative { color: var(--danger-color); }
        
        .admin-section {
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            margin-bottom: var(--space-xl);
            overflow: hidden;
        }
        
        .section-header {
            padding: var(--space-lg);
            border-bottom: 1px solid var(--gray-200);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .section-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--gray-900);
        }
        
        .section-content {
            padding: var(--space-lg);
        }
        
        .users-table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .users-table th,
        .users-table td {
            padding: var(--space-md);
            text-align: left;
            border-bottom: 1px solid var(--gray-200);
        }
        
        .users-table th {
            background: var(--gray-50);
            font-weight: 600;
            color: var(--gray-700);
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.875rem;
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .user-details h4 {
            margin: 0;
            font-size: 0.875rem;
            color: var(--gray-900);
        }
        
        .user-details p {
            margin: 0;
            font-size: 0.75rem;
            color: var(--gray-600);
        }
        
        .status-badge {
            padding: 0.25rem var(--space-sm);
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            font-weight: 500;
        }
        
        .status-badge.active {
            background: var(--success-color);
            color: white;
        }
        
        .status-badge.inactive {
            background: var(--gray-400);
            color: white;
        }
        
        .status-badge.suspended {
            background: var(--danger-color);
            color: white;
        }
        
        .budget-bar {
            width: 100px;
            height: 8px;
            background: var(--gray-200);
            border-radius: 4px;
            overflow: hidden;
        }
        
        .budget-fill {
            height: 100%;
            background: var(--success-color);
            transition: width 0.3s;
        }
        
        .budget-fill.warning { background: var(--warning-color); }
        .budget-fill.danger { background: var(--danger-color); }
        
        .action-buttons {
            display: flex;
            gap: var(--space-xs);
        }
        
        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .filters-bar {
            display: flex;
            gap: var(--space-md);
            align-items: center;
            margin-bottom: var(--space-lg);
            flex-wrap: wrap;
        }
        

        
        .alert {
            padding: var(--space-md);
            border-radius: var(--radius-md);
            margin-bottom: var(--space-lg);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .alert-success {
            background: #d4edda;
            border: 1px solid #c3e6cb;
            color: #155724;
        }
        
        .alert-error {
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
        }
        
        @media (max-width: 768px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }
            
            .form-row {
                grid-template-columns: 1fr;
            }
            
            .filters-bar {
                flex-direction: column;
                align-items: stretch;
            }
            
            .users-table {
                font-size: 0.875rem;
            }
        }

        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: contents;
            align-items: center;
            justify-content: center;
        }
        
        .login-container {
            background: white;
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            width: 100%;
            max-width: 400px;
            overflow: hidden;
        }
        
        .login-header {
            background: var(--gray-50);
            padding: var(--space-xl);
            text-align: center;
            border-bottom: 1px solid var(--gray-200);
        }
        
        .login-logo {
            font-size: 3rem;
            color: var(--primary-color);
            margin-bottom: var(--space-md);
        }
        
        .login-title {
            font-size: 1.5rem;
            color: var(--gray-900);
            margin-bottom: var(--space-xs);
        }
        
        .login-subtitle {
            color: var(--gray-600);
            font-size: 0.875rem;
        }
        
        .login-body {
            padding: var(--space-xl);
        }
        
        .alert {
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-md);
            margin-bottom: var(--space-lg);
            font-size: 0.875rem;
        }
        
        .alert-error {
            background: var(--danger-color);
            color: white;
        }
        
        .alert-success {
            background: var(--success-color);
            color: white;
        }
        
        .form-tabs {
            display: flex;
            gap: var(--space-sm);
            margin-bottom: var(--space-lg);
        }
        
        .form-tab {
            flex: 1;
            padding: var(--space-sm);
            border: 1px solid var(--gray-300);
            background: white;
            border-radius: var(--radius-md);
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
        }
        
        .form-tab.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }
        
        .form-section {
            display: none;
        }
        
        .form-section.active {
            display: block;
        }
        
        .form-checkbox {
            display: flex;
            align-items: center;
            gap: var(--space-xs);
            margin-bottom: var(--space-lg);
        }
        
        .form-checkbox input {
            width: auto;
        }
        
        .login-footer {
            padding: var(--space-lg);
            background: var(--gray-50);
            text-align: center;
            font-size: 0.875rem;
            color: var(--gray-600);
        }
        
        .login-footer a {
            color: var(--primary-color);
            text-decoration: none;
        }
        
        .login-footer a:hover {
            text-decoration: underline;
        }

        .dashboard-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: var(--space-xl) 0;
            margin-bottom: var(--space-xl);
        }
        
        .welcome-section {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-lg);
        }
        
        .welcome-text h1 {
            font-size: 2rem;
            margin-bottom: var(--space-xs);
        }
        
        .welcome-text p {
            opacity: 0.9;
            font-size: 1.1rem;
        }
        
        .quick-actions {
            display: flex;
            gap: var(--space-md);
        }
        
        .quick-action-btn {
            padding: var(--space-md) var(--space-lg);
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            border-radius: var(--radius-lg);
            text-decoration: none;
            transition: all 0.3s;
            backdrop-filter: blur(10px);
        }
        
        .quick-action-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }
        
        .dashboard-grid {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: var(--space-xl);
            margin-bottom: var(--space-xl);
        }
        
        .main-content {
            display: contents;
            flex-direction: column;
            gap: var(--space-xl);
        }
        
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: var(--space-lg);
        }
        
        .dashboard-card {
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            padding: var(--space-xl);
        }
        
        .card-header {
            display: flex;
            justify-content: between;
            align-items: center;
            margin-bottom: var(--space-lg);
        }
        
        .card-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--gray-900);
        }
        
        .budget-card {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            color: white;
        }
        
        .budget-amount {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: var(--space-sm);
        }
        
        .budget-label {
            opacity: 0.9;
            margin-bottom: var(--space-lg);
        }
        
        .budget-bar {
            background: rgba(255, 255, 255, 0.2);
            height: 8px;
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: var(--space-md);
        }
        
        .budget-fill {
            height: 100%;
            background: white;
            border-radius: 4px;
            transition: width 0.5s ease;
        }
        
        .budget-fill.warning {
            background: #fbbf24;
        }
        
        .budget-fill.critical {
            background: #ef4444;
        }
        
        .budget-details {
            display: flex;
            justify-content: space-between;
            font-size: 0.875rem;
            opacity: 0.9;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: var(--space-lg);
        }
        
        .stat-item {
            text-align: center;
            padding: var(--space-lg);
            background: var(--gray-50);
            border-radius: var(--radius-md);
        }
        
        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: var(--space-xs);
        }
        
        .stat-label {
            color: var(--gray-600);
            font-size: 0.875rem;
        }
        
        .article-list {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
        }
        
        .article-item {
            padding: var(--space-md);
            border: 1px solid var(--gray-200);
            border-radius: var(--radius-md);
            transition: all 0.2s;
        }
        
        .article-item:hover {
            border-color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }
        
        .article-title {
            font-weight: 600;
            color: var(--gray-900);
            margin-bottom: var(--space-xs);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .article-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.75rem;
            color: var(--gray-600);
        }
        
        .transaction-list {
            display: flex;
            flex-direction: column;
            gap: var(--space-sm);
            max-height: 300px;
            overflow-y: auto;
        }
        
        .transaction-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--space-sm);
            border-bottom: 1px solid var(--gray-100);
        }
        
        .transaction-info {
            flex: 1;
        }
        
        .transaction-description {
            font-size: 0.875rem;
            color: var(--gray-900);
            margin-bottom: 2px;
        }
        
        .transaction-date {
            font-size: 0.75rem;
            color: var(--gray-600);
        }
        
        .transaction-amount {
            font-weight: 600;
        }
        
        .transaction-amount.debit {
            color: var(--danger-color);
        }
        
        .transaction-amount.credit {
            color: var(--success-color);
        }
        
        .budget-alert {
            padding: var(--space-md);
            border-radius: var(--radius-md);
            margin-bottom: var(--space-lg);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .budget-alert.warning {
            background: #fef3c7;
            border: 1px solid #f59e0b;
            color: #92400e;
        }
        
        .budget-alert.critical {
            background: #fee2e2;
            border: 1px solid #ef4444;
            color: #991b1b;
        }
        
        @media (max-width: 1024px) {
            .dashboard-grid {
                grid-template-columns: 1fr;
            }
            
            .welcome-section {
                flex-direction: column;
                gap: var(--space-lg);
                text-align: center;
            }
            
            .quick-actions {
                justify-content: center;
            }
        }
        
        @media (max-width: 768px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }
            
            .quick-actions {
                flex-direction: column;
                width: 100%;
            }
        }
        /* Stili per i badge delle fonti GNews.io */
.source-badge.gnews {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.source-badge.newsapi-ai {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
}

.source-badge.newsapi {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
}

/* Stili per le card delle diverse fonti */
.news-card.source-gnews {
    border-left: 3px solid #4CAF50;
}

.news-card.source-newsapi-ai {
    border-left: 3px solid #2196F3;
}

.news-card.source-newsapi {
    border-left: 3px solid #FF9800;
}

/* Miglioramenti per la leggibilità */
.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.news-meta > span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sentiment-badge {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Miglioramenti per il debug */
.debug-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    z-index: 9999;
    max-width: 300px;
}
/* Bordini colorati per le diverse fonti di notizie */

/* GNews.io - Bordino BLU a sinistra */
.news-card.source-gnews {
    border-left: 4px solid #2563eb; /* Blu */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

/* NewsAPI.ai - Bordino VERDE a sinistra (come già hai) */
.news-card.source-newsapi-ai {
    border-left: 4px solid #10b981; /* Verde */
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

/* NewsAPI.org legacy - Bordino ARANCIONE a sinistra */
.news-card.source-newsapi {
    border-left: 4px solid #f59e0b; /* Arancione */
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

/* Badge colorati coordinati */
.source-badge.gnews {
    background: linear-gradient(45deg, #2563eb, #1d4ed8);
    color: white;
}

.source-badge.newsapi-ai {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
}

.source-badge.newsapi {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    color: white;
}

/* Effetto hover per evidenziare meglio la fonte */
.news-card.source-gnews:hover {
    border-left-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.news-card.source-newsapi-ai:hover {
    border-left-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.news-card.source-newsapi:hover {
    border-left-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Assicurati che le card abbiano il border-radius corretto */
.news-card {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Colori più intensi per i badge quando la card è in hover */
.news-card:hover .source-badge.gnews {
    background: linear-gradient(45deg, #1d4ed8, #1e40af);
}

.news-card:hover .source-badge.newsapi-ai {
    background: linear-gradient(45deg, #059669, #047857);
}

.news-card:hover .source-badge.newsapi {
    background: linear-gradient(45deg, #d97706, #b45309);
}
.sorting-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}
/* CSS AGGIUNTIVO per i nuovi pulsanti */
/* Aggiungi questo al tuo style.css esistente */

/* Pulsante "Vedi Articolo" - Verde per indicare successo */
.btn.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn.btn-success i {
    margin-right: 6px;
}

/* Pulsante "Rigenera" - Stile neutro */
.btn.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Layout migliorato per quando ci sono 3 pulsanti */
.news-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.news-actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.875rem;
    padding: 10px 12px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Se ci sono 3 pulsanti, il primo prende più spazio */
.news-actions .btn:first-child {
    flex: 1.5;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .news-actions {
        flex-direction: column;
    }
    
    .news-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .news-actions .btn:first-child {
        flex: 1;
    }
}

/* Animazione per quando i pulsanti cambiano */
.news-card .news-actions {
    animation: buttonUpdate 0.3s ease-in-out;
}

@keyframes buttonUpdate {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Badge per articoli già generati */
.news-card.has-generated-article::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

/* Tooltip per i pulsanti */
.btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.btn[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

/* Migliorie per la paginazione */
.pagination {
    position: relative;
}

.pagination::before {
    content: "Pagina " attr(data-current) " di " attr(data-total);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Loading state migliorato */
.news-card.generating {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.news-card.generating::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
/* AGGIUNGI questo CSS al file assets/css/style.css */

/* Miglioramenti Paginazione */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
    flex-wrap: wrap;
}

.page-info {
    font-weight: 500;
    color: var(--gray-700);
    margin: 0 var(--space-md);
}

/* NUOVO: Stili per "Vai a pagina" */
.page-jump {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 var(--space-md);
}

.page-jump label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.page-jump input {
    width: 60px;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.page-jump input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.page-jump input:invalid {
    border-color: var(--error-color);
}

.page-jump .btn {
    min-width: auto;
    padding: var(--space-xs) var(--space-sm);
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .page-jump {
        order: -1; /* Mostra prima sui mobile */
    }
    
    .page-info {
        margin: 0;
    }
}

/* Animazione per feedback visivo */
.page-jump input.loading {
    background: linear-gradient(90deg, #f3f4f6 25%, transparent 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: pageJumpLoading 1.5s ease-in-out infinite;
}

@keyframes pageJumpLoading {
    0% { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}
#articleLength option, #writingStyle option {
    display: block !important;
    visibility: visible !important;
}
/* 4. CSS - Aggiungi questi stili al tuo style.css */

/* === TRADUZIONE SMART STYLES === */

/* Pulsante traduzione */
.btn-translation {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white !important;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-translation:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

.btn-translation:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-translation.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-translation.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Badge traduzione */
.translation-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Contenuto originale */
.original-content {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    border-left: 4px solid #64748b;
}

.original-header h4 {
    margin: 0 0 0.5rem 0;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
}

.original-content h5 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 500;
}

.original-content p {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Note di adattamento */
.adaptation-note {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.adaptation-note i {
    color: #3b82f6;
    margin-top: 2px;
    flex-shrink: 0;
}

.adaptation-note small {
    color: #1e40af;
    font-style: italic;
    line-height: 1.4;
}

/* Controlli traduzione globale */
.translate-all-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* Animazioni */
@keyframes translatePulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.btn-translation.translating {
    animation: translatePulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .news-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-translation {
        width: 100%;
        justify-content: center;
    }
    
    .translate-all-controls {
        flex-direction: column;
    }
}

/* Stati hover migliorati */
.news-card:hover .btn-translation {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

/* Indicatore linguaggio */
.language-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Miglioramenti card notizie */
.news-card {
    position: relative;
    transition: all 0.3s ease;
}

.news-card.translated {
    border-left: 4px solid #4f46e5;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

.news-card.translated::before {
    content: "🇮🇹";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    z-index: 2;
}