/**
 * Common Ranking Styles
 * These classes can be styled differently by each layout
 */

/* Container */
.ranking-page {
    width: 100%;
    padding: 0;
}

.ranking-container {
    padding: 15px;
    border-radius: 8px;
}

/* Header */
.ranking-header {
    text-align: center;
    margin-bottom: 20px;
}

.ranking-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.ranking-divider {
    width: 100px;
    height: 2px;
    margin: 0 auto;
}

/* Navigation Tabs */
.ranking-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
}

.ranking-tab {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.ranking-tab.active {
    /* Styled by layout */
}

.ranking-tab:hover {
    /* Styled by layout */
}

/* Events Dropdown */
.events-dropdown {
    position: relative;
    display: inline-block;
}

.events-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.events-submenu {
    position: absolute;
    left: 0;
    margin-top: 4px;
    min-width: 200px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

.events-submenu.hidden {
    display: none;
}

.events-submenu-item {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

/* Event Type Display */
.event-type-display {
    text-align: center;
    margin-bottom: 15px;
}

.event-type-title {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Filters */
.ranking-filters {
    border-top-width: 1px;
    border-top-style: solid;
    padding-top: 12px;
    margin-top: 12px;
}

.class-filter-container,
.monster-filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 12px;
}

.class-filter {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.class-filter.active {
    font-weight: bold;
}

/* Search Form */
.character-search {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top-width: 1px;
    border-top-style: solid;
}

.character-search form {
    display: inline-block;
}

.search-input-group {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.search-input {
    padding: 8px 12px;
    border-radius: 4px;
    border-width: 1px;
    border-style: solid;
    font-size: 12px;
    width: 200px;
    outline: none;
    transition: all 0.2s;
}

.search-button {
    padding: 8px 18px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Monster Select */
.monster-select {
    padding: 8px 12px;
    border-radius: 4px;
    border-width: 1px;
    border-style: solid;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 0;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border-width: 3px;
    border-style: solid;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-left: 12px;
    font-size: 14px;
}

/* Table */
.ranking-table-container {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
}

.ranking-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
}

.ranking-table thead {
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.ranking-table th {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ranking-table td {
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.ranking-table tbody tr {
    transition: all 0.2s;
}

.ranking-table tbody tr:hover {
    /* Styled by layout */
}

/* Position Cell */
.position-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
}

.position-badge.rank-1 {
    /* Gold - styled by layout */
}

.position-badge.rank-2 {
    /* Silver - styled by layout */
}

.position-badge.rank-3 {
    /* Bronze - styled by layout */
}

.vip-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.vip-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Character Name Cell */
.character-name-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.character-link {
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.guild-link {
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.online-indicator.online {
    background-color: #22c55e;
}

.online-indicator.offline {
    background-color: #ef4444;
}

/* Level Display */
.level-display {
    display: inline;
}

.master-level {
    font-size: 9px;
    font-weight: bold;
    vertical-align: super;
    margin-left: 1px;
}

/* Castle Siege Special Styles */
.castle-siege-section {
    margin-bottom: 40px;
}

.castle-siege-section:last-child {
    margin-bottom: 0;
}

.castle-siege-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.castle-siege-title {
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.castle-siege-link {
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.castle-owner-box {
    padding: 20px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
}

.castle-owner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.castle-owner-label {
    font-size: 18px;
    font-weight: bold;
}

.castle-owner-guild {
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
}

.empty-state {
    text-align: center;
    padding: 20px;
}

/* Load More Button */
.load-more-container {
    margin-top: 20px;
    text-align: center;
}

.load-more-container.hidden {
    display: none;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 26px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.load-more-btn:hover {
    /* kolory/cienie nadpisane w blade/css/ranking.css */
}

/* Responsive */
@media (max-width: 768px) {
    .ranking-page {
        padding: 0;
    }

    .ranking-container {
        padding: 10px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .search-input-group {
        flex-direction: column;
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .search-button {
        width: 100%;
    }

    .ranking-nav {
        gap: 4px;
    }

    .ranking-tab {
        padding: 6px 10px;
        font-size: 10px;
    }
}
