/**
 * Battles List Page Styles
 */

/* Root variables for hub accent - set dynamically via JS */
:root {
    --hub-accent: #cf0000;
    --hub-accent-secondary: #9c0303;
    --hub-accent-glow: rgba(207, 0, 0, 0.3);
    --hub-accent-glow-light: rgba(207, 0, 0, 0.2);
}

/* Beats hub overrides */
[data-hub="beats"] {
    --hub-accent: #3b82f6;
    --hub-accent-secondary: #1e40af;
    --hub-accent-glow: rgba(59, 130, 246, 0.3);
    --hub-accent-glow-light: rgba(59, 130, 246, 0.2);
}

/* --- Page Container & Background --- */
.battles-page-container {
    position: relative;
    padding: 5rem 0;
    background-color: #050505;
    min-height: 100vh;
    overflow: hidden;
}

/* Ambient Background Glows */
.battles-page-container::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--hub-accent) 0%, transparent 70%);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.battles-page-container::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--hub-accent) 0%, transparent 70%);
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 2;
}

/* --- HUB TABS STYLES --- */
.hub-switch-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    background: #111;
    border: 1px solid #333;
    border-radius: 50px;
    padding: 0.5rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.hub-tab {
    padding: 0.75rem 2rem;
    border-radius: 40px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: #777;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.hub-tab svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Rap Tab Active State */
.hub-tab.active-rap {
    background-color: #cf0000;
    color: #fff;
    box-shadow: 0 0 15px rgba(207, 0, 0, 0.5);
}

/* Beatbox Tab Active State */
.hub-tab.active-beats {
    background-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.hub-tab:hover:not(.active-rap):not(.active-beats) {
    color: #fff;
    background-color: #222;
}

/* --- Header --- */
.battles-page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.hub-icon-container {
    margin-bottom: 1rem;
    color: var(--hub-accent);
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem auto;
}

.battles-page-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.battles-page-header p {
    font-size: 1.2rem;
    color: #aaa;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #333;
}

.form-group label {
    color: #aaa;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

/* Custom Select Styling */
.form-control-select {
    background-color: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control-select:focus {
    outline: none;
    border-color: var(--hub-accent);
    box-shadow: 0 0 0 3px var(--hub-accent-glow-light);
}

/* --- Battle Grid --- */
.battles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

.battles-empty {
    color: #aaa;
    text-align: center;
    grid-column: 1 / -1;
    font-style: italic;
    font-size: 1.2rem;
}

/* --- Battle Card Premium --- */
.battle-card {
    background: #111;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.battle-card:hover {
    transform: translateY(-5px);
    border-color: var(--hub-accent);
    box-shadow: 0 10px 30px -10px var(--hub-accent-glow);
}

.card-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
    background: rgba(255,255,255,0.02);
}

.card-status {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-status-live {
    background-color: var(--hub-accent);
    color: #fff;
    box-shadow: 0 0 10px var(--hub-accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.card-status-time {
    background-color: #333;
    color: #ccc;
}

.card-status-time svg {
    width: 14px;
}

.card-status-voting {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: pulse 2s infinite;
}

.card-status-finished {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
}

.card-type {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hub-accent);
    border: 1px solid var(--hub-accent);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.card-body {
    padding: 2rem 1.5rem;
    text-align: center;
    flex-grow: 1;
}

.matchup-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mc-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 40%;
}

.mc-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #222;
    background-size: cover;
    background-position: center;
    border: 2px solid #444;
    transition: border-color 0.3s;
}

.battle-card:hover .mc-avatar {
    border-color: var(--hub-accent);
}

.battle-avatar {
    background-size: cover;
    background-position: center;
}

.mc-name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    color: #fff;
}

.vs-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #333;
    font-style: italic;
}

.viewer-count {
    color: #777;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.viewer-count svg {
    width: 16px;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid #222;
    background: #0e0e0e;
}

.btn-action {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-watch {
    background: linear-gradient(90deg, var(--hub-accent), var(--hub-accent-secondary));
    color: white;
    border: none;
}

.btn-watch:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.btn-watch-finished {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-watch-voting {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    animation: pulse 2s infinite;
}

.btn-remind {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
}

.btn-remind:hover {
    border-color: #fff;
    color: #fff;
}

.battle-card-winner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* --- BATTLE PROCESS SECTION --- */
.battle-process-section {
    margin-top: 3rem;
    padding: 3rem;
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle Top Border matching Hub Color */
.battle-process-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--hub-accent), transparent);
}

.process-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: #fff;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.step-card {
    background: rgba(255,255,255,0.03);
    padding: 2rem 1rem;
    border-radius: 12px;
    transition: transform 0.3s;
    position: relative;
}

.step-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.05);
}

.step-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--hub-accent);
    color: var(--hub-accent);
    box-shadow: 0 0 15px var(--hub-accent-glow-light);
}

.step-icon svg {
    width: 30px;
    height: 30px;
}

.step-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.step-card p {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.5;
}

/* --- Pagination Styles --- */
.pagination-wrapper {
    margin-top: 3rem;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 0.5rem 1rem;
}

.pagination-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-link:hover:not(.disabled) {
    background: var(--hub-accent);
    border-color: var(--hub-accent);
    transform: translateY(-2px);
}

.pagination-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0.5rem;
}

.pagination-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.pagination-number.active {
    background: var(--hub-accent);
    border-color: var(--hub-accent);
    box-shadow: 0 0 15px var(--hub-accent-glow-light);
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: #666;
    font-weight: 600;
}

.pagination-info {
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .process-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .battles-page-header h1 {
        font-size: 2.5rem;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .battles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .card-header {
        padding: 0.875rem 1rem;
        min-height: 50px;
    }
    .card-status {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
        flex-shrink: 0;
    }
    .card-status-time {
        white-space: nowrap;
        overflow: visible;
    }
    .card-type {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
        flex-shrink: 0;
    }
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.75rem;
    }
    .pagination-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    .pagination-number {
        min-width: 36px;
        height: 36px;
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}
