/* ==========================================================================
   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; }

.sl-clan-readmore {
    display: inline;
    margin-left: 4px;
    padding: 0;
    background: none;
    border: none;
    color: var(--theme-color, #e63946);
    font-weight: 700;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.sl-clan-readmore:hover {
    opacity: 0.8;
}

/* ════════════════════════════════════
   DETAIL MODAL ("Mehr lesen")
   ════════════════════════════════════ */
.sl-clan-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
}

.sl-clan-detail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.sl-clan-detail-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #10121a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    padding: 34px;
    border-radius: 20px;
    z-index: 2;
}

.sl-clan-detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    color: #ffffff;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

.sl-clan-detail-image {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.sl-clan-detail-title {
    margin: 0 0 12px;
    font-size: 2rem;
    text-transform: uppercase;
    color: #ffffff;
}

.sl-clan-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

/* Im Modal in normalem Flow statt absolut positioniert wie auf der Karte */
.sl-clan-detail-meta .sl-badge-lang {
    position: static;
    text-shadow: none;
}

.sl-clan-detail-meta .sl-games {
    margin: 0;
}

.sl-clan-detail-content {
    color: #c5c9d1;
    line-height: 1.7;
}

.sl-clan-detail-content p {
    margin: 0 0 1em;
}

.sl-clan-detail-content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .sl-clan-detail-panel {
        padding: 24px;
    }
}

/* ════════════════════════════════════
   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;
}

.sl-clan-submit-button-wrapper {
    text-align: center;
    margin: 20px 0;
}

.sl-clan-submit-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
}

.sl-clan-submit-modal[hidden] {
    display: none;
}

.sl-clan-submit-modal .sl-clan-submit-panel {
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
}

.sl-clan-submit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.sl-clan-submit-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #10121a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    padding: 34px;
    border-radius: 20px;
    z-index: 2;
}

.sl-clan-submit-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    color: #ffffff;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.sl-clan-submit-panel h2 {
    margin: 0 0 16px;
    font-size: 2rem;
}

.sl-clan-submit-panel p {
    margin: 0 0 24px;
    color: #c5c9d1;
}

.sl-clan-submit-form {
    display: grid;
    gap: 18px;
    justify-items: stretch;
}

.sl-clan-submit-row {
    display: grid;
    gap: 10px;
    width: 100%;
}

.sl-clan-submit-row label {
    display: block;
    margin-bottom: 0;
    color: #e7e9ef;
    font-weight: 700;
}

.sl-clan-submit-row small {
    color: #9ca3af;
    font-size: 0.88rem;
    line-height: 1.3;
}

.sl-clan-submit-row input,
.sl-clan-submit-row textarea,
.sl-clan-submit-row select {
    width: 100%;
    min-width: 0;
    background: #1a1d24;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 12px;
    outline: none;
    font-size: 1rem;
    box-sizing: border-box;
}

.sl-clan-submit-row input[type="color"] {
    padding: 0;
    height: 54px;
    cursor: pointer;
    flex: 0 0 80px;
}

.sl-clan-color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.sl-clan-color-swatch {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sl-clan-color-swatch:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.sl-clan-color-label {
    color: #e7e9ef;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sl-clan-submit-row input[type="file"] {
    padding: 12px 14px;
}

.sl-clan-submit-row input:focus,
.sl-clan-submit-row textarea:focus,
.sl-clan-submit-row select:focus {
    border-color: rgba(255, 255, 255, 0.24);
}

.sl-clan-submit-row textarea {
    min-height: 140px;
    resize: vertical;
}

.sl-clan-submit-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.sl-clan-submit-footer button {
    width: auto;
    min-width: 180px;
}

.sl-clan-submit-message {
    color: #c5c9d1;
    font-size: 0.98rem;
    flex: 1 1 220px;
}

@media (max-width: 720px) {
    .sl-clan-submit-panel {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        padding: 18px;
        border-radius: 16px;
    }
    .sl-clan-submit-close {
        top: 16px;
        right: 16px;
    }
    .sl-clan-submit-form {
        gap: 14px;
    }
    .sl-clan-submit-row {
        gap: 8px;
    }
    .sl-clan-submit-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .sl-clan-submit-footer button {
        width: 100%;
        min-width: auto;
    }
    .sl-clan-submit-message {
        margin-top: 6px;
    }
    .sl-clan-submit-row input,
    .sl-clan-submit-row textarea,
    .sl-clan-submit-row select {
        font-size: 0.98rem;
        padding: 12px 14px;
    }
    .sl-clan-submit-row input[type="color"] {
        height: 48px;
        flex: 0 0 64px;
    }
    .sl-clan-color-swatch {
        width: 48px;
        height: 48px;
    }
    .sl-clan-color-label {
        font-size: 0.88rem;
    }
}