/* Repository Plugin - Frontend Styles */

/* Container principale */
.repository-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Sezione di ricerca */
.search-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.search-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background: #005a87;
}

/* Filtri */
.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.filter-select:focus {
    outline: none;
    border-color: #0073aa;
}

/* Sezione statistiche */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Sezione plugin in evidenza */
.featured-plugins {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.section-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Griglia plugin */
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 30px;
}

.plugin-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plugin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: #0073aa;
}

.plugin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
}

.plugin-icon {
    margin-bottom: 15px;
}

.plugin-icon .dashicons {
    font-size: 32px;
    color: #0073aa;
}

.plugin-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.plugin-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.plugin-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.plugin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: #f0f2f5;
    color: #555;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.plugin-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.plugin-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.star {
    font-size: 16px;
    color: #ddd;
}

.star-filled {
    color: #ffd700;
}

.star-half {
    color: #ffd700;
    opacity: 0.7;
}

.rating-text {
    color: #666;
}

.plugin-downloads {
    color: #666;
}

/* Pulsante carica altri */
.load-more-container {
    text-align: center;
    padding: 30px;
    border-top: 1px solid #e1e5e9;
}

.load-more-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Modal plugin */
.plugin-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-modal:hover {
    background: #f0f2f5;
}

.modal-body {
    padding: 30px;
}

.plugin-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 30px;
    align-items: start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.plugin-title h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
    color: #333;
}

.plugin-author {
    color: #666;
    font-size: 14px;
}

.plugin-stats {
    text-align: center;
}

.rating-display {
    margin-bottom: 10px;
}

.downloads-display {
    color: #666;
    font-size: 14px;
}

.download-section {
    text-align: center;
}

.price {
    color: #0073aa;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.download-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.download-btn:hover {
    background: #c82333;
}

.plugin-content h4 {
    color: #0073aa;
    font-size: 18px;
    margin: 25px 0 15px 0;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 8px;
}

.plugin-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.features-section ul {
    list-style: none;
    padding: 0;
}

.features-section li {
    padding: 8px 0;
    color: #555;
    position: relative;
    padding-left: 20px;
}

.features-section li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.technical-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.tech-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.tech-item strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.tech-item span {
    color: #666;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.screenshot-placeholder {
    background: #f8f9fa;
    border: 2px dashed #e1e5e9;
    border-radius: 8px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.screenshot-placeholder .dashicons {
    font-size: 32px;
}

/* Responsive */
@media (max-width: 768px) {
    .repository-container {
        padding: 15px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-select {
        min-width: auto;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .plugins-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .plugin-header {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Stili per le versioni */
.versions-section {
    margin: 25px 0;
}

.versions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.version-item {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.version-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 10px rgba(0, 115, 170, 0.1);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-number {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.version-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.version-status-stable {
    background: #d4edda;
    color: #155724;
}

.version-status-beta {
    background: #fff3cd;
    color: #856404;
}

.version-status-alpha {
    background: #f8d7da;
    color: #721c24;
}

.version-status-legacy {
    background: #e2e3e5;
    color: #383d41;
}

.version-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.version-changelog {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.version-compatibility {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.version-compatibility span {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
}

.version-actions {
    margin-top: 15px;
}

.version-download-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.version-download-btn:hover {
    background: #005a87;
}

.no-versions {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Responsive per le versioni */
@media (max-width: 768px) {
    .version-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .version-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .version-compatibility {
        flex-direction: column;
        gap: 5px;
    }
}

/* Stili per gli screenshot */
.screenshots-section {
    margin: 25px 0;
}

.screenshots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.screenshot-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.screenshot-item:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.screenshot-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.screenshot-image:hover {
    transform: scale(1.05);
}

.screenshot-caption {
    padding: 12px;
    background: #f8f9fa;
    text-align: center;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.no-screenshots {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Modal per screenshot full-size */
.screenshot-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.screenshot-modal-content {
    position: relative;
    margin: 2% auto;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.screenshot-modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.screenshot-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.screenshot-modal-close:hover {
    color: #0073aa;
}

/* Responsive per screenshot */
@media (max-width: 768px) {
    .screenshots-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .screenshot-image {
        height: 150px;
    }
}
