/* Desktop Layout - Content with fixed left margin and responsive right margin */
/* Neue Character List Styles */
.character-list-container {
    margin: 20px 0;
}

.character-list-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: rgb(230, 230, 230);
}

strong {
    color: rgb(230, 230, 230);
}

.character-grid-container {
    width: 100%;
    max-width: none;      /* volle Breite nutzen */
    margin: 0;            /* kein zentrierter fester Bereich mehr */
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); /* 120px + 4px border (2px auf jeder Seite) */
    gap: 15px;
    padding: 20px;
    justify-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow: visible; /* Tooltip darf nicht abgeschnitten werden */
}

/* Mobile hamburger menu spacing */
/* Responsive Design für verschiedene Bildschirmgrößen */
@media (max-width: 1200px) {
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(114px, 1fr)); /* 110px + 4px border */
        gap: 12px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    /* Karten auf Tablets/kleineren Screens ca. 20% kleiner als Desktop (120x168 -> 96x135) */
    .Character-UR, .Character-SSR, .Character-SR, .Character-SP, .Character-R, .Character-N {
        width: 96px !important;
        height: 135px !important;
        box-sizing: border-box !important; /* Border in Breite einberechnen */
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* 96px + 4px border */
        gap: 5px;           /* Mindestabstand 5px zwischen Cards */
        padding: 10px;
    }
}

@media (max-width: 480px) {
    /* Auf Handys: Flexible Breite für Cards, so viele wie Platz ist mit gleichmäßigem Abstand */
    .Character-UR, .Character-SSR, .Character-SR, .Character-SP, .Character-R, .Character-N {
        width: 100% !important;   /* Fülle die Grid-Zelle komplett aus */
        height: auto !important;  /* Höhe automatisch anhand der Breite */
        aspect-ratio: 5 / 7;      /* Seitenverhältnis erzwingen (120:168 ≈ 5:7) */
        min-width: 0;             /* Verhindert Overflow bei Flex/Grid Items */
        box-sizing: border-box !important; /* Border in Breite einberechnen */
    }

    .character-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); /* 80px + 4px border - Flexible Spalten */
        gap: 8px;           /* Gleichmäßiger Abstand zwischen allen Cards */
        padding: 8px;       /* Etwas weniger Padding zum Rand für mehr Platz */
        justify-items: stretch; /* Cards füllen ihre Zelle aus */
        width: 100%;        /* Containerbreite nutzen */
        box-sizing: border-box; /* Padding einbeziehen */
        overflow: visible;   /* Tooltip darf nicht abgeschnitten werden */
    }
}

/* ----------------------------------------------------------------- */
/* JAPAN DISCLAIMER MODAL STYLES (from TierList) */
/* ----------------------------------------------------------------- */

/* Japan Disclaimer Modal Styles - Dark Theme */
.disclaimer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.disclaimer-content {
    background: #1A1A1D;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
    border: 2px solid #3c3c3f;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.disclaimer-header {
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #3c3c3f;
}

.disclaimer-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-disclaimer {
    font-size: 32px;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    color: white;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.close-disclaimer:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.disclaimer-body {
    padding: 25px;
    color: #ffffff;
    line-height: 1.6;
    background: linear-gradient(180deg, #1A1A1D 0%, #2A2A2D 100%);
}

.disclaimer-body p {
    margin: 15px 0;
    font-size: 15px;
    color: #e0e0e0;
}

.disclaimer-body p:first-child {
    margin-top: 0;
}

.disclaimer-body p:last-child {
    margin-bottom: 0;
}

.disclaimer-footer {
    padding: 20px;
    text-align: center;
    border-top: 2px solid #3c3c3f;
    background: #1A1A1D;
    border-radius: 0 0 12px 12px;
}

.disclaimer-footer button {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.disclaimer-footer button:hover {
    background: linear-gradient(135deg, #357ABD, #2A5F8A);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

/* ----------------------------------------------------------------- */
/* NEW FILTER BAR STYLES (from 7kRebirth) - FIXED */
/* ----------------------------------------------------------------- */

.employees-filter-bar.lost {
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-bar-element {
    display: flex;
    align-items: center;
}

/* Search Field */
.filter-bar-element.search {
    position: relative;
    margin-right: 4px;
}

.filter-bar-element.search input.form-control {
    background-color: #0e0e11;
    border: 1px solid #32323e;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 0 30px 0 10px;
    font-size: 0.9rem;
    height: 38px;
    width: 200px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    line-height: 38px;
}

.filter-bar-element.search input.form-control:focus {
    outline: none;
    border-color: #7a5af8a1;
}

.filter-bar-element.search .clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: none;
    user-select: none;
}

.filter-bar-element.search input:not(:placeholder-shown) + .clear {
    display: block;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #32323e;
}

#filterSystem .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #212126;
    color: #a0a0a0;
    border: none;
    border-right: 1px solid #32323e;
    padding: 0 16px;
    height: 38px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    margin: 0;
    min-width: auto;
    border-radius: 0;
}

/* Allow targeting old class names within new container with high specificity */
#filterSystem .rarity-filter-btn,
#filterSystem .category-filter-btn,
#filterSystem .region-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #212126 !important;
    color: #a0a0a0 !important;
    border: none !important;
    border-right: 1px solid #32323e !important;
    padding: 0 16px !important;
    height: 38px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    margin: 0 !important;
    min-width: auto !important;
    border-radius: 0 !important;
}

#filterSystem .btn:first-child,
#filterSystem .rarity-filter-btn:first-child,
#filterSystem .category-filter-btn:first-child,
#filterSystem .region-btn:first-child {
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}

#filterSystem .btn:last-child,
#filterSystem .rarity-filter-btn:last-child,
#filterSystem .category-filter-btn:last-child,
#filterSystem .region-btn:last-child {
    border-right: none !important;
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

#filterSystem .btn:hover,
#filterSystem .rarity-filter-btn:hover,
#filterSystem .category-filter-btn:hover,
#filterSystem .region-btn:hover {
    background-color: #2a2a30 !important;
    color: #fff !important;
}

#filterSystem .btn.active,
#filterSystem .rarity-filter-btn.active,
#filterSystem .category-filter-btn.active,
#filterSystem .region-btn.active {
    background-color: #7a5af8a1 !important;
    color: #fff !important;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) !important;
    border-color: #7a5af8a1 !important;
}

#filterSystem .btn svg {
    fill: currentColor;
}

/* Reset Button */
#filterSystem .reset-button,
#filterSystem .reset-all-btn {
    background-color: #2a2a30 !important;
    border: 1px solid #32323e !important;
    border-radius: 4px !important;
    color: #a0a0a0 !important;
    padding: 0 16px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    font-size: 0.9rem !important;
    margin-left: 0 !important; /* Override potential margin-left: auto */
}

#filterSystem .reset-button:not([disabled]):hover,
#filterSystem .reset-all-btn:not([disabled]):hover {
    background-color: #7a5af8a1 !important;
    border-color: #7a5af8a1 !important;
    color: white !important;
}

#filterSystem .reset-button[disabled],
#filterSystem .reset-all-btn[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Images inside buttons */
#filterSystem .btn img,
#filterSystem .category-filter-btn img {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain !important;
    transition: filter 0.2s !important;
    display: block !important;
    margin: 0 !important;
}

/* School Dropdown Styling */
select.form-control,
#filterSystem .school-dropdown {
    background-color: #212126 !important;
    color: #a0a0a0 !important;
    border: 1px solid #32323e !important;
    height: 38px !important;
    border-radius: 4px !important;
    padding: 0 10px !important;
    cursor: pointer !important;
    min-width: 120px !important;
}
select.form-control:focus,
#filterSystem .school-dropdown:focus {
    outline: none !important;
    border-color: #7a5af8a1 !important;
}

/* Mobile responsiveness for Filter Bar */
@media (max-width: 1080px) {
    .employees-filter-bar.lost {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        background-color: rgba(0,0,0,0.2);
    }

    .filter-bar-element {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }

    .filter-bar-element:last-child {
        margin-bottom: 0;
    }

    .filter-bar-element.search input.form-control {
        width: 100%;
    }

    .btn-group {
        width: 100%;
        display: flex;
    }

    #filterSystem .btn,
    #filterSystem .rarity-filter-btn,
    #filterSystem .category-filter-btn,
    #filterSystem .region-btn {
        flex: 1;
        padding: 0 4px !important;
        font-size: 0.85rem !important;
    }

    #filterSystem .reset-button,
    #filterSystem .reset-all-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Specific adjustments for Haikyuu elements */
    .filter-bar-element.search {
        margin-right: 0;
    }
}

/* Character Card Styles - angepasst für Grid */
.Character-UR, .Character-SSR, .Character-SR, .Character-SP, .Character-R, .Character-N {
    /* 20% größer als vorher (100x140) */
    transition: all 0.3s ease;
    box-sizing: border-box !important; /* Border in Breite einberechnen */
}

.Character-UR:hover, .Character-SSR:hover, .Character-SR:hover, .Character-SP:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: none;
}

/* Rarity-spezifische Styles und Backgrounds */
.Character-UR {
    background: linear-gradient(to top, rgba(227, 56, 57, 0.8), rgba(227, 56, 57, 0.4), rgba(0, 0, 0, 0.3)) !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0px !important;
}

.Character-SSR {
    background: linear-gradient(to top, rgba(222, 144, 19, 0.8), rgba(222, 144, 19, 0.4), rgba(0, 0, 0, 0.3)) !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0px !important;
}

.Character-SR {
    background: linear-gradient(to top, rgba(138, 43, 226, 0.8), rgba(138, 43, 226, 0.4), rgba(0, 0, 0, 0.3)) !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0px !important;
}

.Character-R {
    background-image: url("/Haikyu-FlyHigh/img/BackroundR.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.Character-N {
    background-image: url("/Haikyu-FlyHigh/img/BackroundN.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.Character-SP {
    background: linear-gradient(135deg, rgb(199, 229, 255) 0%, rgb(90, 166, 247) 50%, rgb(91, 110, 229) 100%) !important;
    box-shadow: none !important;
    position: relative !important;
    border: none !important;
    margin: 0px !important;
}

/* Sicherstellen, dass SP Characters ihr eigenes Hintergrundbild haben */
.Character-SP[data-rarity="SP"] {
    background: linear-gradient(135deg, rgb(199, 229, 255) 0%, rgb(90, 166, 247) 50%, rgb(91, 110, 229) 100%) !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0px !important;
}

/* Character Name Overlay - Dark Gradient */
.character-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    color: white;
    padding: 20px 4px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem; /* Slightly smaller for Haikyu cards */
    z-index: 25;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Character tooltip (hover name) - DEPRECATED but kept for structure */
.Character-UR, .Character-SSR, .Character-SR, .Character-SP, .Character-R, .Character-N {
    position: relative;
    overflow: visible;
    z-index: 1;
}

.Character-UR:hover, .Character-SSR:hover, .Character-SR:hover, .Character-SP:hover, .Character-R:hover, .Character-N:hover {
    z-index: 10;
}

.Character-UR:hover .character-tooltip,
.Character-SSR:hover .character-tooltip,
.Character-SR:hover .character-tooltip,
.Character-SP:hover .character-tooltip,
.Character-R:hover .character-tooltip,
.Character-N:hover .character-tooltip {
    opacity: 1;
    visibility: visible;
}

/* R and N rarity characters are filtered out completely */

/* Global Tooltip Styles */
#global-tooltip {
    position: fixed;
    background: rgba(34, 24, 36, 0.95);
    color: rgb(230, 230, 230);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    max-width: 200px;
    word-wrap: break-word;
}

#global-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(34, 24, 36, 0.95);
}

/* Global tooltip wird per JavaScript gesteuert */



