/* Content Management System Styles */

/* News Modal */
.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.modal-close {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.modal-body {
    overflow-y: auto;
    max-height: 90vh;
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.modal-info {
    padding: 30px;
}

.modal-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.modal-category {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 500;
}

.modal-date {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.3;
}

.modal-content {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .news-modal {
        padding: 10px;
    }
    
    .modal-container {
        max-height: 95vh;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 24px;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 18px;
    color: #666;
}

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

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

/* Error States */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px 0;
}

.error-message i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* Enhanced News Cards */
.news-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.news-card.featured {
    border: 2px solid var(--accent-color);
    position: relative;
}

.news-card.featured::before {
    content: 'In Evidenza';
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

/* Enhanced Gallery Items */
.gallery-item {
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Auto-generated content indicators */
.auto-content {
    border-left: 4px solid var(--accent-color);
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%);
}

.auto-content::after {
    content: 'Aggiornato automaticamente';
    display: block;
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 10px;
    font-style: italic;
}

/* Admin hints (visibili solo in sviluppo) */
.admin-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #17a2b8;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.admin-hint.show {
    display: block;
    animation: slideInUp 0.3s ease-out;
}

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