html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #1a1a1a;
    color: #fff;
    font-family: sans-serif;
    background-image: url('../images/dark_hunter_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* This helps prevent flickering */
}

.container {
    width: 80%;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.game-version {
    padding: 10px 20px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
}

.scarlet {
    background-color: #ff4d4d;
}

.violet {
    background-color: #9933ff;
}

.game-version.active {
    border: 2px solid #7e00d2;
    box-shadow: 0 0 10px #fff;
}

.pokeball {
    width: 50px;
    height: 50px;
    background-image: url('../images/sv-teraraid.png');
    background-size: contain;
    background-repeat: no-repeat;
    margin: 0 20px;
}

.filters {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.star-button {
    background-color: #4d4d4d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, border 0.3s;
}

.star-button:hover {
    background-color: #666;
}

.star-button.active {
    background-color: #007bff; /* A more distinct color for active state */
    border: 2px solid #7e00d2;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.7); /* Add a subtle glow */
}

select, input[type="text"] {
    background-color: #333;
    color: #fff;
    border: 1px solid #7e00d2;
    padding: 10px;
    border-radius: 5px;
    width: 200px;
}

.searchable-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #7e00d2;
    z-index: 1;
}

.dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #4d4d4d;
}

.show {
    display: block;
}

.raid-list table {
    width: 100%;
    border-collapse: collapse;
    min-width: 950px; /* Adjusted for new Stars column */
}

.raid-list th, .raid-list td {
    border: 1px solid #7e00d2;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85em;
}

.raid-list th {
    background-color: #333;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Column widths for desktop */
.raid-list th:nth-child(1), .raid-list td:nth-child(1) { width: 9%; } /* ID */
.raid-list th:nth-child(2), .raid-list td:nth-child(2) { width: 14%; } /* Pokemon */
.raid-list th:nth-child(3), .raid-list td:nth-child(3) { width: 11%; } /* Ability */
.raid-list th:nth-child(4), .raid-list td:nth-child(4) { width: 9%; } /* Nature */
.raid-list th:nth-child(5), .raid-list td:nth-child(5) { width: 3%; } /* HP */
.raid-list th:nth-child(6), .raid-list td:nth-child(6) { width: 4%; } /* ATK */
.raid-list th:nth-child(7), .raid-list td:nth-child(7) { width: 4%; } /* DEF */
.raid-list th:nth-child(8), .raid-list td:nth-child(8) { width: 4%; } /* SPA */
.raid-list th:nth-child(9), .raid-list td:nth-child(9) { width: 4%; } /* SPD */
.raid-list th:nth-child(10), .raid-list td:nth-child(10) { width: 4%; } /* SPE */
.raid-list th:nth-child(11), .raid-list td:nth-child(11) { width: 3%; } /* Gender */
.raid-list th:nth-child(12), .raid-list td:nth-child(12) { width: 4%; } /* Tera Type */
.raid-list th:nth-child(13), .raid-list td:nth-child(13) { width: 5%; } /* Mark */
.raid-list th:nth-child(14), .raid-list td:nth-child(14) { width: 4%; } /* Stars */

.raid-list tbody tr:hover {
    background-color: rgba(77, 77, 77, 0.7);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

/* Tera Type Image Styles */
.tera-type-image {
    height: 24px; /* Size for desktop */
    width: auto;
    vertical-align: middle;
    display: inline-block;
}

/* No Event Message */
.no-event-message {
    display: none;
    text-align: center;
    font-size: 1.2em;
    color: #ff4d4d;
    margin: 20px 0;
    font-weight: bold;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745; /* Green for success */
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.toast-notification.show {
    opacity: 1;
    bottom: 40px;
}

/* Custom Tooltip */
#custom-tooltip {
    position: fixed;
    display: none;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    z-index: 1001;
    pointer-events: none; /* So it doesn't interfere with mouse events on the row */
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #7e00d2;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Mobile-specific styles */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }
    .game-version {
        font-size: 18px;
        padding: 8px 16px;
    }
    .pokeball {
        width: 40px;
        height: 40px;
    }
    .filters {
        padding: 10px;
    }
    .filter-group {
        flex-direction: column;
        align-items: center;
    }
    select, input[type="text"] {
        width: 100%;
        max-width: 150px;
        padding: 8px;
        font-size: 0.9em;
    }
    .star-button {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    .raid-list table {
        font-size: 0.8em;
        min-width: 850px;
    }
    .raid-list th, .raid-list td {
        padding: 6px;
    }
    /* Redistribute column widths for mobile */
    .raid-list th:nth-child(1), .raid-list td:nth-child(1) { width: 11%; } /* ID */
    .raid-list th:nth-child(2), .raid-list td:nth-child(2) { width: 16%; } /* Pokemon */
    .raid-list th:nth-child(3), .raid-list td:nth-child(3) { width: 12%; } /* Ability */
    .raid-list th:nth-child(4), .raid-list td:nth-child(4) { width: 10%; } /* Nature */
    .raid-list th:nth-child(5), .raid-list td:nth-child(5) { width: 3%; } /* HP */
    .raid-list th:nth-child(6), .raid-list td:nth-child(6) { width: 4%; } /* ATK */
    .raid-list th:nth-child(7), .raid-list td:nth-child(7) { width: 4%; } /* DEF */
    .raid-list th:nth-child(8), .raid-list td:nth-child(8) { width: 4%; } /* SPA */
    .raid-list th:nth-child(9), .raid-list td:nth-child(9) { width: 4%; } /* SPD */
    .raid-list th:nth-child(10), .raid-list td:nth-child(10) { width: 4%; } /* SPE */
    .raid-list th:nth-child(11), .raid-list td:nth-child(11) { width: 3%; } /* Gen */
    .raid-list th:nth-child(12), .raid-list td:nth-child(12) { width: 4%; } /* Tera Type */
    .raid-list th:nth-child(13), .raid-list td:nth-child(13) { width: 6%; } /* Mark */
    .raid-list th:nth-child(14), .raid-list td:nth-child(14) { width: 5%; } /* Stars */
    .tera-type-image {
        height: 20px; /* Smaller size for mobile */
        width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 5px;
    }
    .game-version {
        font-size: 16px;
        padding: 6px 12px;
    }
    .pokeball {
        width: 30px;
        height: 30px;
    }
    .star-button {
        font-size: 0.8em;
        padding: 6px 12px;
    }
    .raid-list th, .raid-list td {
        font-size: 0.7em;
        padding: 4px;
    }
    .tera-type-image {
        height: 18px; /* Even smaller for very small screens */
    }
}