/**
 * Challenge Showcase CSS
 * Professional styling for public challenge showcase pages
 * Responsive design with modern UI components
 */

/* ===== CHALLENGE SHOWCASE CONTAINER ===== */
.challenge-showcase-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ===== HERO SECTIONS ===== */
.challenge-hero-section,
.open-challenges-hero {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.challenge-hero-section::before,
.open-challenges-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.hero-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.hero-stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.hero-stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CHALLENGE CARDS ===== */
.challenge-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.challenge-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

.challenge-card .card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.challenge-card .card-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.challenge-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.challenge-card .card-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.challenge-card .card-title a:hover {
    color: #007bff;
}

.challenge-card .card-text {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* ===== CHALLENGE STATUS ===== */
.challenge-status {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.challenge-meta {
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.meta-item i {
    width: 16px;
    text-align: center;
    color: #007bff;
}

/* ===== CHALLENGE REWARDS ===== */
.challenge-rewards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.fee-info,
.free-info,
.token-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.fee-info {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.free-info {
    background: #d1edff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.token-info {
    background: #e2e3ff;
    color: #383d41;
    border: 1px solid #c3c4ff;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 120px;
}

/* ===== SEARCH AND FILTERS ===== */
.search-filters-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #dee2e6;
}

.search-form {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: #495057;
}

.search-input,
.filter-select {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.search-button {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== CHALLENGE DETAILS PAGE ===== */
.challenge-header {
    margin-bottom: 2rem;
}

.challenge-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.challenge-description {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.9;
}

.challenge-stats-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.75rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CHALLENGE CONTENT SECTIONS ===== */
.challenge-content-section {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.challenge-content-section h3 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.content-block {
    margin-bottom: 2rem;
}

.content-block:last-child {
    margin-bottom: 0;
}

.content-block h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

.content-text {
    line-height: 1.7;
    color: #6c757d;
}

/* ===== CRITERIA LIST ===== */
.criteria-list {
    space-y: 1.5rem;
}

.criterion-item {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #007bff;
}

.criterion-item h6 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subcriteria-list {
    margin-top: 1rem;
    padding-left: 1rem;
}

.subcriteria-list li {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

/* ===== SIDEBAR ===== */
.challenge-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-section h5 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.detail-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-list i {
    color: #007bff;
    margin-top: 0.25rem;
    width: 16px;
    text-align: center;
}

/* ===== RELATED CHALLENGES ===== */
.related-challenges-section {
    padding: 4rem 0;
}

.related-challenges-section h3 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* ===== NO CHALLENGES STATE ===== */
.no-challenges-state {
    padding: 4rem 2rem;
    text-align: center;
}

.no-challenges-state i {
    margin-bottom: 2rem;
}

.no-challenges-state h3 {
    color: #495057;
    margin-bottom: 1rem;
}

/* ===== OPEN CHALLENGE CARDS ===== */
.open-challenge-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.open-challenge-card:hover {
    border-color: #28a745;
    transform: translateY(-2px);
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

.cta-section h3 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-section .lead {
    color: #6c757d;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== PAGINATION — modern pill style (shared with showcase) ===== */
.showcase-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f4f0;
    border-radius: 50px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.showcase-pagination .spag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e0e6e0;
    color: var(--primary-green, #3d7a56);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s, color .2s, box-shadow .2s;
}
.showcase-pagination .spag-btn:hover {
    background: var(--primary-green, #3d7a56);
    color: #fff;
    border-color: var(--primary-green, #3d7a56);
    box-shadow: 0 4px 12px rgba(61,122,86,.25);
}
.showcase-pagination .spag-btn.spag-disabled {
    opacity: .4;
    pointer-events: none;
    cursor: default;
}

.showcase-pagination .spag-pages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.showcase-pagination .spag-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e0e6e0;
    color: #2d4a3e;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.showcase-pagination .spag-page:hover {
    background: #e8f2ec;
    border-color: var(--primary-green, #3d7a56);
    color: var(--primary-green, #3d7a56);
}
.showcase-pagination .spag-page.spag-active {
    background: var(--primary-green, #3d7a56);
    border-color: var(--primary-green, #3d7a56);
    color: #fff;
    box-shadow: 0 4px 12px rgba(61,122,86,.3);
    cursor: default;
    pointer-events: none;
}

.showcase-pagination .spag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    color: #8a9e92;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: white;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    color: rgba(255, 255, 255, 0.6);
}

/* ===== BADGES ===== */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.badge-primary {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.badge-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .challenge-title {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .challenge-sidebar {
        position: static;
        margin-top: 2rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        min-width: auto;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .search-form {
        padding: 1rem;
    }

    .challenge-content-section {
        padding: 1.5rem;
    }

    .sidebar-section {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .challenge-title {
        font-size: 1.5rem;
    }

    .challenge-card .card-body {
        padding: 1rem;
    }

    .challenge-card .card-footer {
        padding: 1rem;
    }

    .challenge-content-section {
        padding: 1rem;
    }

    .sidebar-section {
        padding: 1rem;
    }

    .challenge-stats-card {
        padding: 1.5rem;
    }
}

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid #f3f3f3;
    border-top: 0.25rem solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.challenge-card:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .challenge-card {
        border: 2px solid #000;
    }

    .badge {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .challenge-card,
    .btn,
    .search-button {
        transition: none;
    }

    .loading-spinner {
        animation: none;
    }
}