.explore-header {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.explore-header h2 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.search-filters {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.search-form {
    width: 100%;
}

.search-form-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-group {
    flex: 2;
}

.select-group {
    flex: 1;
    min-width: 150px;
}

.input-group input,
.select-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--background);
    transition: all 0.2s ease;
}

.search-button {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.search-button:hover {
    background-color: var(--primary-dark);
}

.input-group input:focus,
.select-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.project-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-header {
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-title {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-right: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-title a {
    text-decoration: none;
    color: var(--secondary); /* mantiene lo stesso colore del titolo */
}

.project-title a:hover {
    color: var(--primary); /* opzionale: cambia colore al passaggio del mouse */
}

.badge {
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background-color: var(--success);
    color: white;
}

.badge-ended {
    background-color: var(--text-light);
    color: white;
}

.project-creator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.creator-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1rem;
}

.project-description {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.project-meta {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.progress-container {
    height: 8px;
    background-color: var(--background);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    transition: width 0.3s ease;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.2rem 0;
    text-align: center;
    background-color: var(--background);
    padding: 1rem;
    border-radius: 8px;
}

.stat-value {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-button {
    display: inline-block;
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.project-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.page-button:hover {
    background-color: var(--background);
}

.page-button.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.no-results {
    text-align: center;
    padding: 3rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.no-results h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.sorting {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.sort-select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--text);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .search-form-container {
        flex-direction: column;
        gap: 1rem;
    }

    .input-group,
    .select-group {
        width: 100%;
    }

    .search-button {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        border-radius: 10px;
    }

    .project-info {
        padding: 1.25rem;
    }

    .project-stats {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .stat-value {
        font-size: 0.85rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}