/* AlbionBB Style - Clean and Simple */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0f1419;
    color: #8b949e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header simples */
.header {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 1rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.powered-by {
    font-family: 'Orbitron', monospace;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #58a6ff;
    text-shadow: 0 0 3px rgba(88, 166, 255, 0.15);
    margin-top: -0.15rem;
}

.navbar-brand a {
    text-decoration: none;
    outline: none;
    border: none;
}

.navbar-brand a:hover,
.navbar-brand a:focus,
.navbar-brand a:active {
    text-decoration: none;
    outline: none;
    border: none;
}

.brand-text {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
}

.server-label {
    font-size: 12px;
    font-weight: 600;
}

.dropdown-arrow {
    color: #8b949e;
    transition: transform 0.2s;
    margin-left: 6px;
    font-size: 10px;
}

.server-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.server-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    cursor: pointer;
    font-family: inherit;
    min-width: 60px;
    gap: 8px;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
}

.server-dropdown-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.25);
}

.dropdown-arrow {
    color: #8b949e;
    transition: transform 0.2s ease;
    font-size: 10px;
}

.server-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 4px;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: none;
}

.server-dropdown-item {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #8b949e;
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s;
}

.server-dropdown-item:hover {
    background-color: #21262d;
    color: #f0f6fc;
}

.server-dropdown-item.active {
    background-color: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

/* Discord Button */
.discord-btn {
    margin-left: 15px;
    padding: 10px 10px;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
    width: 40px;
    height: 40px;
}

.discord-btn:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    background-color: #21262d;
}

.discord-btn i {
    margin: 0;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar-nav a {
    color: #c4c4c4;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.api-docs-link {
    background-color: #238636;
    color: #ffffff !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.api-docs-link:hover {
    background-color: #2ea043;
    transform: translateY(-1px);
}

.api-docs-link:active {
    background-color: #1a7f2f;
    transform: translateY(0);
}

/* Main content */ 
.main-content {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: #c4c4c4;
    margin-bottom: 2rem;
}

/* Search form acima da tabela */
.search-form {
    margin: 0 0 1.5rem 0;
}

.search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #30363d;
    background-color: #161b22;
    color: #c9d1d9;
    border-radius: 4px;
    font-size: 14px;
    width: 300px;
    max-width: 300px;
}

.search-input:focus {
    outline: none;
    border-color: #58a6ff;
}

.min-players-group {
    display: flex;
    align-items: center;
}

.min-players-label {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-right: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 4px 0 0 4px;
    color: #8b949e;
    font-size: 13px;
    white-space: nowrap;
    height: 38px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.min-players-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #30363d;
    background-color: #161b22;
    color: #c9d1d9;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    min-width: 80px;
    cursor: pointer;
    height: 38px;
    line-height: 1;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%238b949e" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px;
    padding-right: 2rem;
}

.min-players-select:focus {
    outline: none;
    border-color: #58a6ff;
}

.search-group input,
.search-group select {
    padding: 0.5rem 1rem;
    border: 1px solid #30363d;
    background-color: #161b22;
    color: #c9d1d9;
    border-radius: 4px;
    font-size: 14px;
}

.search-group input:focus,
.search-group select:focus {
    outline: none;
    border-color: #58a6ff;
}

.search-btn {
    background-color: #238636;
    color: #ffffff;
    border: 1px solid #238636;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.search-btn:hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

/* Tabela estilo AlbionBB */
h2 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.battles-table-container {
    background-color: #0d1117;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #30363d;
}

.battles-table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
}

.battles-table thead th {
    background-color: #161b22;
    color: #f0f6fc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid #30363d;
}

.battles-table tbody tr {
    border-bottom: 1px solid #21262d;
    transition: background-color 0.1s;
    cursor: pointer;
}

.battles-table tbody tr:hover {
    background-color: #161b22;
}

.battles-table tbody td {
    padding: 0.8rem 1rem;
    color: #8b949e;
    font-size: 13px;
}

/* Date column sem server flag */
.battle-date {
    color: #8b949e !important;
    min-width: 100px;
    font-size: 13px;
}

/* Colunas de stats com cores exatas do AlbionBB */
.battle-players {
    color: #58a6ff !important;
    font-weight: 500;
    text-align: center;
}

.battle-kills {
    color: #f85149 !important;
    font-weight: 500;
    text-align: center;
}

.battle-fame {
    color: #d29922 !important;
    font-weight: 500;
    text-align: center;
}

.battle-link {
    text-align: center;
    color: #58a6ff !important;
    font-weight: 500;
}

.battle-detail-link {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.battle-detail-link:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* Participants/enemies column */
.battle-enemies {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsivo */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .battles-table-container {
        overflow-x: auto;
    }
    
    .battles-table {
        min-width: 600px;
    }
    
    .battles-table thead th,
    .battles-table tbody td {
        padding: 0.6rem 0.8rem;
        font-size: 13px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Loading states */
.loading {
    text-align: center;
    color: #c4c4c4;
    padding: 2rem;
}

.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background-color: #161b22;
    border-top: 1px solid #30363d;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-link {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #79c0ff;
    text-decoration: none;
}

/* Pagination */
.pagination-controls {
    margin-top: 15px;
    margin-bottom: 20px;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    padding: 4px;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #f0f6fc;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 26px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #30363d;
    border-color: #58a6ff;
    color: #58a6ff;
    text-decoration: none;
}

.pagination-btn.active {
    background-color: #58a6ff;
    border-color: #58a6ff;
    color: #0d1117;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #8b949e;
    padding: 0 4px;
    font-size: 12px;
}

.pagination-info {
    color: #8b949e;
    margin: 0 20px;
    font-size: 14px;
}

/* ==================== Battle Detail Page ==================== */

/* Back button */
.back-link {
    margin-bottom: 1.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    color: #58a6ff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    background-color: transparent;
}

.back-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
    color: #79c0ff;
}

/* Battle header */
.battle-header {
    margin-bottom: 2rem;
    text-align: center;
}

.battle-header h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.battle-meta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.server-badge,
.cluster-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
}

.server-badge {
    background-color: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.25);
    color: #58a6ff;
}

/* Battle Header Compact */
.battle-header-compact {
    margin-bottom: 2rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem 1.5rem;
}

.battle-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.battle-title-row h1 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.battle-stats-inline {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid #30363d;
}

.stat-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #8b949e;
    font-size: 13px;
}

.stat-inline i {
    color: #58a6ff;
    font-size: 12px;
}

/* Battle stats grid */
.battle-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.2rem;
    text-align: center;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #58a6ff;
    background-color: rgba(88, 166, 255, 0.05);
}

.stat-label {
    color: #8b949e;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    color: #f0f6fc;
    font-size: 1.5rem;
    font-weight: 600;
}

.stat-value.player-count {
    color: #58a6ff;
}

.stat-value.kills-count {
    color: #f85149;
}

.stat-value.fame-count {
    color: #d29922;
}

.stat-value.damage-count {
    color: #f85149;
}

.stat-value.heal-count {
    color: #3fb950;
}

/* Tabs navigation */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #30363d;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    color: #8b949e;
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #f0f6fc;
    background-color: rgba(88, 166, 255, 0.05);
}

.tab-btn.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Two columns layout for battle stats (alliances + guilds) */
.battle-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.battle-column {
    min-width: 0; /* Prevent overflow */
}

.battle-column h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Top Stats Section */
.top-stats-section {
    margin-bottom: 2rem;
}

.top-stats-section h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.stat-player {
    color: #8b949e;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    font-weight: 400;
}

/* Players Section */
.players-section {
    margin-bottom: 2rem;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.players-section h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
}

.players-search {
    margin: 0;
}

.players-search .search-input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 1rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
}

.players-search .search-input:focus {
    outline: none;
    border-color: #58a6ff;
}

/* Participants table */
.participants-table tbody tr {
    height: 48px;
}

.participants-table tbody td {
    padding: 0.5rem 1rem !important;
    vertical-align: middle;
}

.participants-table .participant-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 32px;
}

.participants-table .player-weapon-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px;
    flex-shrink: 0;
}

.participants-table .player-weapon-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 3px;
    color: #58a6ff;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.participants-table .tag {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: 3px;
    color: #58a6ff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.participants-table .no-alliance,
.participants-table .no-guild {
    color: #6e7681;
    font-style: italic;
}

/* Sortable table headers */
.battles-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.battles-table th.sortable:hover {
    background-color: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

.battles-table th.sortable i {
    margin-left: 0.3rem;
    font-size: 0.75em;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.battles-table th.sortable:hover i {
    opacity: 1;
}

.battles-table th.sortable i.fa-sort-up,
.battles-table th.sortable i.fa-sort-down {
    opacity: 1;
    color: #00d4ff;
}

/* Events section */
.events-section {
    margin-top: 2rem;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.events-section h3 {
    margin: 0;
    color: #c9d1d9;
    font-size: 1.25rem;
}

.events-search {
    margin: 0;
}

.events-search .search-input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 1rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
}

.events-search .search-input:focus {
    outline: none;
    border-color: #58a6ff;
}

.events-table .event-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.events-table .weapon-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px;
    flex-shrink: 0;
}

.events-table .weapon-icon-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 4px;
    color: #58a6ff;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.events-table .player-info {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.action-btn {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid #58a6ff;
    border-radius: 4px;
    color: #58a6ff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: rgba(88, 166, 255, 0.2);
    border-color: #79c0ff;
    color: #79c0ff;
}

/* No data message */
.no-data {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 3rem;
    text-align: center;
    color: #8b949e;
}

.no-data p {
    margin: 0;
    font-size: 14px;
}

/* Responsive adjustments for battle detail */
@media (max-width: 768px) {
    .battle-header-compact {
        padding: 0.8rem 1rem;
    }
    
    .battle-title-row {
        gap: 0.5rem;
    }
    
    .battle-title-row h1 {
        font-size: 1.2rem;
    }
    
    .battle-stats-inline {
        gap: 1rem;
        font-size: 12px;
    }
    
    .stat-inline {
        font-size: 12px;
    }
    
    .battle-header h1 {
        font-size: 1.5rem;
    }
    
    .battle-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Stack columns on mobile */
    .battle-two-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Players section responsive */
    .players-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .players-search .search-input {
        width: 100%;
        max-width: 100%;
        font-size: 12px;
    }
    
    .participants-table .player-weapon-icon,
    .participants-table .player-weapon-placeholder {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    /* Events section responsive */
    .events-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .events-search .search-input {
        width: 100%;
        font-size: 12px;
    }
    
    /* Events table responsive */
    .events-table .weapon-icon,
    .events-table .weapon-icon-placeholder {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .events-table .event-player {
        font-size: 12px;
        gap: 0.25rem;
    }
