/* ================================================
   DUEL REPLAYS - MODERN PREMIUM DESIGN
   ================================================ */

.replays-section {
    min-height: 100vh;
    padding: calc(80px + 3rem) 0 4rem;
    background: var(--dark-bg);
}

/* Header */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-header h1 i {
    font-size: 2.2rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--silver);
    opacity: 0.8;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(201, 169, 98, 0.08) 0%, rgba(137, 87, 229, 0.05) 100%);
    border: 1px solid rgba(201, 169, 98, 0.15);
    border-radius: 16px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-height: 1rem;
}

.filter-group .ghost-label {
    visibility: hidden;
}

.filter-group select,
.filter-group input {
    padding: 0.7rem 1rem;
    background: rgba(15, 15, 25, 0.9);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: 10px;
    color: var(--white);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.15);
}

.filter-group select option {
    background: #1a1a2e;
}

/* Duels Grid */
.duels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* ================================================
   DUEL CARD - MODERN PREMIUM DESIGN
   ================================================ */
.duel-card {
    background: linear-gradient(145deg, rgba(25, 25, 40, 0.95) 0%, rgba(15, 15, 25, 0.98) 100%);
    border: 1px solid rgba(201, 169, 98, 0.15);
    border-radius: 20px;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.duel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--purple-hint), var(--gold));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.duel-card:hover {
    transform: translateY(-6px);
    border-color: rgba(201, 169, 98, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(201, 169, 98, 0.1);
}

.duel-card:hover::before {
    opacity: 1;
}

/* Card Header */
.duel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(201, 169, 98, 0.05);
    border-bottom: 1px solid rgba(201, 169, 98, 0.1);
}

.duel-result {
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.duel-result.victory {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.duel-result.defeat {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.duel-result.draw {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.duel-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Card Body */
.duel-body {
    padding: 1.25rem;
}

/* Players Section */
.duel-players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.duel-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.duel-player:last-child {
    flex-direction: row-reverse;
    text-align: right;
}

.duel-player:last-child .player-info {
    text-align: right;
}

.player-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 2px solid rgba(201, 169, 98, 0.4);
    object-fit: cover;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.duel-card:hover .player-avatar {
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(201, 169, 98, 0.3);
}

.placeholder-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.5) 0%, rgba(137, 87, 229, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    border: 2px solid rgba(155, 89, 182, 0.4);
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    color: var(--white);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-level {
    font-size: 0.75rem;
    color: var(--gold);
    opacity: 0.9;
}

.player-house {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.15rem;
}

/* VS Icon */
.vs-icon {
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 800;
    opacity: 0.7;
    text-shadow: 0 0 10px rgba(201, 169, 98, 0.3);
    flex-shrink: 0;
}

/* Stats Row */
.duel-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 0;
}

.duel-stats-row .stat-item {
    text-align: center;
    padding: 0.5rem 0.25rem;
}

.duel-stats-row .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
    line-height: 1.2;
}

.duel-stats-row .stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

/* Card Footer - Like & Comment Buttons */
.duel-card-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(201, 169, 98, 0.03);
    border-top: 1px solid rgba(201, 169, 98, 0.1);
}

.duel-card-footer .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 169, 98, 0.2);
    background: rgba(201, 169, 98, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.duel-card-footer .btn:hover {
    border-color: var(--gold);
    background: rgba(201, 169, 98, 0.15);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 98, 0.2);
}

.duel-card-footer .btn i {
    font-size: 0.9rem;
}

.duel-card-footer .btn .count {
    font-weight: 700;
    margin-left: 0.25rem;
}

/* Won/Lost Card States */
.duel-card.won {
    border-left: 4px solid #10b981;
}

.duel-card.lost {
    border-left: 4px solid #ef4444;
}

.duel-card.draw {
    border-left: 4px solid #f59e0b;
}

/* ================================================
   LOADING & EMPTY STATES
   ================================================ */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--silver);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(201, 169, 98, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--gold);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.4rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--silver);
    max-width: 400px;
    margin: 0 auto;
}

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.pagination-btn {
    padding: 0.7rem 1.25rem;
    background: rgba(201, 169, 98, 0.1);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: 10px;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(201, 169, 98, 0.2);
    border-color: var(--gold);
    transform: translateY(-2px);
}

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

#pageInfo {
    font-size: 0.95rem;
    color: var(--silver);
    font-weight: 500;
}

/* ================================================
   MODAL
   ================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, rgba(25, 25, 40, 0.98) 0%, rgba(15, 15, 25, 1) 100%);
    border: 1px solid rgba(201, 169, 98, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(20, 20, 30, 0.5);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

/* Modal Detail Styles */
.duel-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(201, 169, 98, 0.08);
    border-bottom: 1px solid rgba(201, 169, 98, 0.15);
}

.duel-modal-title {
    font-size: 1.5rem;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
}

.duel-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--silver);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.duel-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.duel-modal-body {
    padding: 1.5rem;
}

.duel-modal-players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.duel-modal-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.duel-modal-player .player-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
}

.duel-modal-player .player-name {
    font-size: 1.1rem;
    text-align: center;
}

.duel-modal-player .player-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.duel-modal-player .player-status.winner {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.duel-modal-player .player-status.loser {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.duel-modal-vs {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold);
    opacity: 0.6;
}

/* Modal Stats */
.duel-modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.duel-modal-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(201, 169, 98, 0.05);
    border: 1px solid rgba(201, 169, 98, 0.1);
    border-radius: 12px;
}

.duel-modal-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.duel-modal-stat .stat-label {
    font-size: 0.75rem;
    color: var(--silver);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Feedback Section */
.duel-section-title {
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 600;
}

.duel-feedback-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(201, 169, 98, 0.1);
}

.duel-feedback-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-feedback {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 98, 0.2);
    background: rgba(201, 169, 98, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-feedback:hover {
    transform: translateY(-2px);
}

.btn-feedback.feedback-like:hover {
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.btn-feedback.feedback-dislike:hover {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-feedback .count {
    font-weight: 700;
}

/* Comments Section */
.duel-feedback-comments {
    margin-top: 1.5rem;
}

.duel-comments-list {
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.duel-comments-empty {
    color: var(--silver);
    opacity: 0.6;
    font-style: italic;
}

.duel-comment-item {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.duel-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.duel-comment-author {
    font-weight: 600;
    color: var(--gold);
    font-size: 0.85rem;
}

.duel-comment-date {
    font-size: 0.7rem;
    color: var(--silver);
    opacity: 0.6;
}

.duel-comment-body {
    color: var(--white);
    font-size: 0.9rem;
    line-height: 1.5;
}

.duel-comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.duel-comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 15, 25, 0.9);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: 12px;
    color: var(--white);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

.duel-comment-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.duel-comment-form .btn-primary {
    align-self: flex-end;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--gold) 0%, #b8941f 100%);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.duel-comment-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 169, 98, 0.4);
}

/* Battle Log */
.duel-battle-log {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(201, 169, 98, 0.1);
}

.duel-battle-log-empty {
    color: var(--silver);
    opacity: 0.6;
    font-style: italic;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .replays-section {
        padding: calc(70px + 2rem) 0 3rem;
    }

    .section-header h1 {
        font-size: 2rem;
    }

    .filter-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
        min-width: auto;
    }

    .duels-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .duel-card {
        border-radius: 16px;
    }

    .duel-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        border-radius: 16px;
        max-height: 90vh;
    }

    .duel-modal-players {
        flex-direction: column;
        gap: 1.5rem;
    }

    .duel-modal-vs {
        font-size: 1.2rem;
    }

    .duel-modal-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .duel-feedback-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .duel-players {
        flex-direction: column;
        gap: 1rem;
    }

    .duel-player,
    .duel-player:last-child {
        flex-direction: row;
        width: 100%;
        text-align: left;
    }

    .duel-player:last-child .player-info {
        text-align: left;
    }

    .vs-icon {
        align-self: center;
    }

    .duel-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
