/* ==========================================================================
   DISEÑOS DE LA COMUNIDAD - 3D HELMETS BY NZI
   ========================================================================== */

/* Ambient Glow and Base Page Background */
body.disenos-comunidad {
    background-color: #0c0c0c !important;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body.disenos-comunidad::before {
    content: '';
    position: absolute;
    top: 250px;
    left: -250px;
    width: 600px;
    height: 900px;
    background: radial-gradient(ellipse at center, rgba(224, 29, 17, 0.16) 0%, rgba(224, 29, 17, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

body.disenos-comunidad::after {
    content: '';
    position: absolute;
    top: 350px;
    right: -250px;
    width: 600px;
    height: 900px;
    background: radial-gradient(ellipse at center, rgba(224, 29, 17, 0.16) 0%, rgba(224, 29, 17, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.content-comunidad {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 24px 60px 24px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

/* Page Title */
.title_comunidad {
    font-family: "ControllerExtW01-Three", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: clamp(26px, 3.8vw, 44px);
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 15px 0 35px 0;
    line-height: 1.2;
}

/* Search Bar */
.search-comunidad-wrapper {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 40px auto;
}

.search-comunidad-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-comunidad-box .search-icon {
    position: absolute;
    left: 18px;
    color: #707070;
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-comunidad-input {
    width: 100%;
    height: 48px;
    background: #181818;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    padding: 0 45px 0 50px;
    font-size: 15px;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    color: #ffffff;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.search-comunidad-input::placeholder {
    color: #6a6a6a;
    font-weight: 400;
}

.search-comunidad-input:focus {
    border-color: #f42f1c;
    background: #1c1c1c;
    box-shadow: 0 0 12px rgba(244, 47, 28, 0.22);
}

.search-comunidad-input:focus + .search-icon {
    color: #f42f1c;
}

.clear-search-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.clear-search-btn:hover {
    color: #fff;
}

/* Grid Layout */
.community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
    transition: opacity 0.22s ease-in-out;
}

.community-grid.is-loading {
    opacity: 0.35;
    pointer-events: none;
}


/* Community Card Base */
.community-card {
    background: #1c1c1c;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    padding: 22px 22px 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    box-sizing: border-box;
}

.community-card:hover {
    transform: translateY(-4px);
    border-color: #404040;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Card Header (Badge & Likes) */
.community-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 38px;
}

.community-card .likes-count {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #a0a0a0;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Helmet Thumbnail Image */
.community-card .card-image-wrapper {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 18px 0;
}

.community-card .card-image-wrapper a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.community-card .helmet-thumb {
    max-height: 195px;
    max-width: 90%;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.community-card:hover .helmet-thumb {
    transform: scale(1.06) translateY(-2px);
}

/* Meta & Action Row */
.community-card .card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    gap: 12px;
}

.community-card .card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #e2e2e2;
    overflow: hidden;
}

.community-card .info-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-card .info-label {
    color: #b0b0b0;
    font-weight: 400;
}

.community-card .info-val {
    color: #ffffff;
    font-weight: 600;
}

/* Like Button */
.community-card .card-action-like {
    flex-shrink: 0;
}

.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #242424;
    border: 1px solid #444444;
    border-radius: 6px;
    color: #d4d4d4;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-like .like-icon {
    transition: transform 0.2s ease, fill 0.2s ease;
}

.btn-like:hover {
    border-color: #f42f1c;
    color: #ffffff;
    background: #2d2020;
}

.btn-like.liked {
    background: #f42f1c;
    border-color: #f42f1c;
    color: #ffffff;
}

.btn-like.liked .like-icon {
    fill: #ffffff;
    stroke: #ffffff;
}

@keyframes likePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

.btn-like.like-anim {
    animation: likePulse 0.35s ease;
}

/* Action Buttons Row */
.community-card .card-buttons-row {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 10px;
    width: 100%;
}

.community-card .btn-custom3d,
.community-card .btn-order {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Regular Card Buttons */
.community-card .btn-custom3d {
    background: transparent;
    border: 1px solid #484848;
    color: #e2e2e2;
}

.community-card .btn-custom3d:hover {
    border-color: #888888;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.community-card .btn-order {
    background: #f42f1c;
    border: 1px solid #f42f1c;
    color: #ffffff;
}

.community-card .btn-order:hover {
    background: #d81f0d;
    border-color: #d81f0d;
    box-shadow: 0 4px 12px rgba(244, 47, 28, 0.35);
}

/* ==========================================================================
   PODIUM CARDS (1º, 2º, 3º - Vibrant NZI Red Style)
   ========================================================================== */
.community-card.podium {
    background: linear-gradient(180deg, #d81e13 0%, #b2140a 100%);
    border: 1px solid #e22d22;
    box-shadow: 0 10px 30px rgba(216, 30, 19, 0.32);
}

.community-card.podium:hover {
    border-color: #ff4a3e;
    box-shadow: 0 14px 38px rgba(216, 30, 19, 0.45);
}

/* Podium Badge */
.community-card.podium .podium-badge {
    font-family: "ControllerExtW01-Three", -apple-system, sans-serif;
    font-size: 38px;
    font-weight: 900;
    color: #ffffff;
    line-height: 0.95;
    letter-spacing: -1px;
    display: inline-flex;
    align-items: flex-start;
}

.community-card.podium .podium-badge .rank-degree {
    font-size: 22px;
    margin-left: 2px;
    border-bottom: 2px solid #ffffff;
    line-height: 0.8;
}

.community-card.podium .likes-count {
    color: rgba(255, 255, 255, 0.92);
}

.community-card.podium .info-label {
    color: rgba(255, 255, 255, 0.82);
}

.community-card.podium .info-val {
    color: #ffffff;
}

/* Like Button on Podium */
.community-card.podium .btn-like {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: #ffffff;
}

.community-card.podium .btn-like:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

.community-card.podium .btn-like.liked {
    background: #ffffff;
    border-color: #ffffff;
    color: #b2140a;
}

.community-card.podium .btn-like.liked .like-icon {
    fill: #b2140a;
    stroke: #b2140a;
}

/* Action Buttons on Podium */
.community-card.podium .btn-custom3d {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
}

.community-card.podium .btn-custom3d:hover {
    background: rgba(255, 255, 255, 0.18);
}

.community-card.podium .btn-order {
    background: #000000;
    border: 1px solid #000000;
    color: #ffffff;
}

.community-card.podium .btn-order:hover {
    background: #181818;
    border-color: #181818;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* Empty State */
.empty-community-designs {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #181818;
    border-radius: 12px;
    border: 1px dashed #333;
}

.empty-community-designs p {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 20px;
}

.btn-create-first {
    display: inline-block;
    background: #f42f1c;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-create-first:hover {
    background: #d81f0d;
}

.no-results-msg {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #888;
}

/* Pagination */
.community-pagination,
.community-pagination-static {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
    margin: 55px 0 35px 0;
    user-select: none;
}

.community-pagination a,
.community-pagination span,
.community-pagination-static span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "ControllerExtW01-Three", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: #888888;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.15s ease;
    padding: 2px 4px;
}

.community-pagination a {
    cursor: pointer;
}

.community-pagination a:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.community-pagination a:active {
    transform: translateY(0);
}

.community-pagination .page-number.current,
.community-pagination-static .page-number.current {
    color: #f42f1c !important;
    font-weight: 700;
    cursor: default;
}

.community-pagination .page-arrow,
.community-pagination-static .page-arrow {
    font-family: "ControllerExtW01-Three", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 22px;
    color: #888888;
}

.community-pagination a.page-arrow:hover {
    color: #ffffff;
}

.community-pagination .page-arrow.disabled,
.community-pagination-static .page-arrow.disabled {
    color: #383838 !important;
    cursor: default;
    pointer-events: none;
}

.community-pagination .page-ellipsis {
    color: #666666;
    font-size: 20px;
    cursor: default;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media screen and (max-width: 1140px) {
    .community-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

@media screen and (max-width: 720px) {
    .content-comunidad {
        padding: 15px 16px 40px 16px;
    }

    .title_comunidad {
        font-size: 24px;
        margin: 10px 0 25px 0;
        letter-spacing: 1.5px;
    }

    .search-comunidad-wrapper {
        margin-bottom: 28px;
    }

    .search-comunidad-input {
        height: 44px;
        font-size: 13px;
        padding: 0 35px 0 42px;
    }

    .community-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .community-card {
        padding: 18px;
    }

    .community-card .card-image-wrapper {
        height: 190px;
    }

    .community-card .helmet-thumb {
        max-height: 170px;
    }

    .community-card .card-buttons-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
