/* Keyword Page - Versione Migliorata */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Hero Section */
.keyword-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.keyword-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    backdrop-filter: blur(1px);
}

.keyword-hero .container {
    position: relative;
    z-index: 1;
}

.keyword-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    line-height: 1.2;
}

.keyword-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.keyword-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    max-width: 600px;
}

.stat-box {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.keyword-image img {
    width: 100%;
    max-width: 250px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.keyword-image img:hover {
    transform: scale(1.05);
}

/* Sections */
.translations-section,
.comments-section,
.contributors-section,
.related-section {
    padding: 3rem 0;
}

.translations-section {
    background: var(--bg-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header .count {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.filter-controls .form-select {
    min-width: 150px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.view-controls {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-white);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.view-controls .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.view-controls .btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Translation Cards */
.translations-grid {
    display: grid;
    gap: 1.5rem;
}

.translation-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border-left: 3px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
}

.translation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.translation-language {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.85rem;
}

.translation-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.status-approved {
    color: var(--success-color);
}

.status-pending {
    color: var(--warning-color);
}

.translation-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.translation-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.stat-item:hover {
    background: #e2e8f0;
}

.stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.translation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.translator-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.translator-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Comments Section */
.comments-container {
    max-width: 700px;
}

.comment-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.comment-user {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9rem;
    word-wrap: break-word;
}

/* Contributors Grid */
.contributors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.contributor-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.contributor-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.contributor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 auto 0.75rem;
}

.contributor-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.contributor-stats {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Related Keywords */
.related-keywords {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.related-keyword {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.related-keyword:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
    text-decoration: none;
    border-color: var(--primary-color);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 3rem 0;
}

.cta-card {
    text-align: center;
    color: white;
}

.cta-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.cta-card p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Loading and Error States */
.loading-container,
.error-container {
    padding: 4rem 0;
    text-align: center;
}

.error-container i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Breadcrumb */
.keyword-breadcrumb {
    padding: 1.5rem 0 1rem;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 992px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filter-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .keyword-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .translation-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .keyword-hero {
        padding: 40px 0 30px;
    }
    
    .keyword-title {
        font-size: 1.75rem;
    }
    
    .keyword-meta {
        gap: 0.5rem;
    }
    
    .meta-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .stat-box {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .translations-section,
    .comments-section,
    .contributors-section,
    .related-section {
        padding: 2rem 0;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .translation-card {
        padding: 1rem;
    }
    
    .translation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .translation-text {
        font-size: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .view-controls {
        justify-content: center;
    }
    
    .contributors-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .keyword-title {
        font-size: 1.5rem;
    }
    
    .keyword-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .translation-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .related-keywords {
        grid-template-columns: 1fr 1fr;
    }
}

/* Smooth transitions */
* {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Focus states for accessibility */
.btn:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .keyword-hero {
        background: none;
        color: black;
    }
    
    .cta-section {
        display: none;
    }
}