/* ==========================================================================
   SwitzerLAN Clan Directory – Sci-Fi Card Design
   ========================================================================== */

:root {
    --clan-card-bg:   #13151a; /* Darkened slightly to match the target mockup */
    --clan-text:      #e8eaf0;
    --clan-text-muted:#7a8090;
    --clan-text-dim:  #50555f;
    --clan-red:       rgba(158, 11, 11, 0.8);
    --clan-transition:0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --cc: 20px;   /* chamfer (top corners)    */
    --nn: 20px;   /* notch   (bottom corners) */
}

.sl-clan-directory {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 60px;
    font-family: 'Roboto', sans-serif;
    color: var(--clan-text);
}

/* ════════════════════════════════════
   FILTER BAR
   ════════════════════════════════════ */
.sl-clan-filters {
    display: flex;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.sl-clan-filters input[type="text"] {
    order: 1;
    flex: 1;
    min-width: 180px;
    background: #ffffff;
    color: #000000;
    border: none;
    /* Simulate the clipped red border by pushing a thick left border through the clip-path */
    border-left: 13px solid var(--clan-red);
    border-top: 2px solid var(--clan-red);
    border-bottom: 2px solid var(--clan-red);
    border-right: none;
    border-radius: 0;
    
    padding: 11px 18px 11px 18px;
    outline: none;
    height: 56px;
    box-sizing: border-box;
    clip-path: polygon(
        12px 0, 100% 0,
        100% 100%, 12px 100%,
        0 calc(100% - 12px), 0 12px
    );
    font-size: 18px;
    font-family: 'Roboto', sans-serif;
    
    font-weight: 600;
    margin-right: 0; /* Touches search button seamlessly */
}

.sl-clan-filters input[type="text"]::placeholder {
    color: #666;
    font-family: 'Roboto', sans-serif;
}

.sl-clan-filters input[type="text"]:focus {
    background: #fff5f5;
}

.sl-btn-search {
    order: 2;
    
    background: linear-gradient(0deg, rgba(64, 20, 20, 0.8) 0%, rgba(158, 11, 11, 0.8) 100%);
   
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0 24px;
    height: 56px;
    cursor: pointer;
    outline: none;
    transition: filter var(--clan-transition);
    clip-path: polygon(
        0 0, calc(calc(100% - 2px) - 12px) 0,
        100% 12px, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 0 100%
    );
    margin-left: -1px; /* Fuses the button perfectly to the input box */
    margin-right: 15px; /* Gap before Language button */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
}

.sl-clan-filters select[name="c_lang"] {
    order: 3;
    margin-right: 15px;
}

.sl-clan-filters select[name="c_game"] {
    order: 4;
}

.sl-clan-filters select {
    background-color: var(--clan-red);
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    height: 56px;
    padding: 0 40px 0 20px;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
    transition: filter var(--clan-transition);
    
    font-family: 'Roboto', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.sl-btn-search:hover,
.sl-clan-filters select:hover {
    filter: brightness(1.15);
}

.sl-clan-filters select option {
    background: #1a1d22;
    color: #fff;
    font-weight: 400;
    text-transform: none;
}

/* ════════════════════════════════════
   CLAN GRID
   ════════════════════════════════════ */
.sl-clan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* ════════════════════════════════════
   CLAN CARD - Outer wrapper 
   ════════════════════════════════════ */
.sl-clan-card {
    background-color: var(--theme-color, #444);
    clip-path: polygon(
        var(--cc)               0%,
        calc(100% - var(--cc))  0%,
        100%                    var(--cc),
        100%                    calc(100% - var(--nn)),
        calc(100% - var(--nn))  calc(100% - var(--nn)),
        calc(100% - var(--nn))  100%,
        var(--nn)               100%,
        var(--nn)               calc(100% - var(--nn)),
        0%                      calc(100% - var(--nn)),
        0%                      var(--cc)
    );
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    
    /* OVERRIDE: Remove buggy native HTML borders that clip weirdly */
    border: none !important; 
    transition: transform var(--clan-transition), filter var(--clan-transition);
    animation: clanCardReveal 0.45s ease both;
}

.sl-clan-card:nth-child(1) { animation-delay: 0.05s; }
.sl-clan-card:nth-child(2) { animation-delay: 0.12s; }
.sl-clan-card:nth-child(3) { animation-delay: 0.19s; }
.sl-clan-card:nth-child(4) { animation-delay: 0.26s; }
.sl-clan-card:nth-child(5) { animation-delay: 0.33s; }
.sl-clan-card:nth-child(6) { animation-delay: 0.40s; }

.sl-clan-card:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 14px 30px rgba(0,0,0,0.6));
}

@keyframes clanCardReveal {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Inner Dark Area (::before) handling uniform 2px border layout mathematically */
.sl-clan-card::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    background-color: var(--clan-card-bg);
    z-index: 0;
    clip-path: polygon(
        calc(var(--cc) - 2px)              0%,
        calc(100% - var(--cc) + 2px)       0%,
        100%                               calc(var(--cc) - 2px),
        100%                               calc(100% - var(--nn)),
        calc(100% - var(--nn))             calc(100% - var(--nn)),
        calc(100% - var(--nn))             100%,
        var(--nn)                          100%,
        var(--nn)                          calc(100% - var(--nn)),
        0%                                 calc(100% - var(--nn)),
        0%                                 calc(var(--cc) - 2px)
    );
}

.sl-card-header,
.sl-card-body,
.sl-card-footer {
    position: relative;
    z-index: 1;
}

/* ════════════════════════════════════
   CARD HEADER
   ════════════════════════════════════ */
.sl-card-header {
    margin: 2px 2px 0 2px;
    height: 220px;
    position: relative;
    clip-path: polygon(
        calc(var(--cc) - 2px)              0%,
        calc(100% - var(--cc) + 2px)       0%,
        100%                               calc(var(--cc) - 2px),
        100%                               100%,
        0%                                 100%,
        0%                                 calc(var(--cc) - 2px)
    );
    background-color: #0e1014;
    overflow: hidden;
}

.sl-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.sl-clan-card:hover .sl-card-header img {
    transform: scale(1.04);
}

/* Gradient blending image cleanly into the body background */
.sl-card-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--clan-card-bg));
    pointer-events: none;
    z-index: 1;
}

/* Hovering transparent Badge without black background */
.sl-badge-lang {
    position: absolute;
    top: 14px;
    left: 14px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

/* ════════════════════════════════════
   CARD BODY
   ════════════════════════════════════ */
.sl-card-body {
    padding: 16px 24px 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    color: #e2e2e2;
}

.sl-card-body h3 {
    margin: 0 0 6px 0;
    font-size: 1.35rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
}

.sl-card-body h3::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: var(--theme-color, #e63946);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--theme-color, #e63946);
}

.sl-card-body h3:has(img)::before { display: none; }

.sl-card-body h3 img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sl-games {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    line-height: 1.5;
}


.sl-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #a0a0a0;
    flex-grow: 1;
}

.sl-excerpt p { margin: 0; }

/* ════════════════════════════════════
   CARD FOOTER - Sci-fi chamfered button
   ════════════════════════════════════ */
.sl-card-footer {
    padding: 16px 24px 24px;
    margin-top: auto;
}

.sl-btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 70px);
    box-sizing: border-box;
    text-align: center;
    padding: 15px 20px;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background-color: var(--theme-color, #e63946);
    border: none;
    cursor: pointer;
    border-radius: 0; 
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.22);
    transition: filter var(--clan-transition), transform 0.15s;
    
    /* Adds the cut corners identical to the mockup */
    clip-path: polygon(
        12px 0, 100% 0,
        100% calc(100% - 12px), calc(100% - 12px) 100%,
        0 100%, 0 12px
    );
    margin: auto;
}

.sl-btn-cta:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* Hide fallback native corners that stick out */
.sl-corner-bl,
.sl-corner-br {
    display: none !important;
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 960px) {
    .sl-clan-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .sl-clan-grid { grid-template-columns: 1fr; gap: 16px; }
    .sl-card-header { height: 180px; }
    .sl-clan-filters { gap: 10px; }
    
    .sl-clan-filters input[type="text"] {
        flex: 1 1 100%;
        margin-right: 0;
    }
    
    .sl-btn-search,
    .sl-clan-filters select[name="c_lang"],
    .sl-clan-filters select[name="c_game"] {
        flex: 1;
        margin-right: 0;
    }
    
    .sl-btn-search {
        margin-left: 0;
        clip-path: polygon(
            12px 0, calc(100% - 12px) 0,
            100% 12px, 100% calc(100% - 12px),
            calc(100% - 12px) 100%, 12px 100%,
            0 calc(100% - 12px), 0 12px
        ); /* Gives all 4 chamfers on mobile */
    }
}

.sl-clan-card h3 {
    font-family: "Roboto", sans-serif;
}