/* Map Detail Page Styles */

/* Back Button */
.back-button-container {
    max-width: 1400px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(20, 30, 40, 0.9);
    border: 2px solid #ff8c00;
    border-radius: 8px;
    color: #ff8c00;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-button:hover {
    background: rgba(255, 140, 0, 0.2);
    border-color: #ffa500;
    color: #ffa500;
    transform: translateX(-5px);
}

.back-arrow {
    font-size: 1.5rem;
    line-height: 1;
}

.back-text {
    line-height: 1;
}

/* Main Container */
.map-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

.map-detail-container .loading,
.map-detail-container .error {
    text-align: center;
    padding: 60px 20px;
    color: #a0a0a0;
    font-size: 1.2rem;
}

.map-detail-container .error {
    color: #ff6b6b;
}

/* Layout: Left side (map info) and Right side (records table) */
.map-detail-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
}

/* Left Side: Map Info Section */
.map-info-section {
    display: flex;
    flex-direction: column;
}

.map-info-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.map-header {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.difficulty-logo {
    height: 50px;
    width: auto;
    flex-shrink: 0;
}

.map-header-text {
    flex: 1;
}

.map-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0px;
}

.map-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    color: #a0a0a0;
}

.map-game,
.map-enviro {
    color: #a0a0a0;
    font-weight: 600;
}

.map-separator {
    color: #ffffff;
}

.enviro-logo {
    height: 35px;
    width: auto;
    vertical-align: middle;
    margin: 0px;
}

.map-thumbnail-large {
    width: 100%;
    overflow: hidden;
    border-top: 1px solid rgba(255, 140, 0, 0.2);
}

.map-thumbnail-large img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Map Statistics */
.map-stats {
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid rgba(255, 140, 0, 0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #a0a0a0;
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-value {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.stat-flag {
    height: 24px;
    width: auto;
    margin-right: 4px;
    padding-bottom: 2px;
    vertical-align: middle;
}

/* Right Side: Records Section */
.records-section {
    display: flex;
    flex-direction: column;
}

.records-table-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    /* border: 2px solid rgba(255, 140, 0, 0.3); */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

/* Records Table */
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Lexend", "Century Gothic", Verdana, sans-serif;
}

.records-table thead {
    background: rgba(0, 0, 0, 0);
    position: sticky;
    top: 0;
    z-index: 10;
}

.records-table th {
    padding: 7px 10px;
    /* text-align: center; */
    font-weight: 700;
    color: #bbbbbb;
    font-size: 1.3rem;
    /* border-bottom: 2px solid rgba(255, 140, 0, 0.5); */
}

.rank-header {
    width: 50px;
    text-align: center;
}

.player-header {
    width: 200px;
    text-align: left;
}

.time-header,
.date-header {
    width: 180px;
    text-align: center;
}

.tags-header {
    width: auto;
}

.expand-header {
    width: 50px;
}

/* Record Rows */
.record-row {
    /* background: rgba(30, 40, 50, 0.8); */
    border-top: 1px solid rgba(50, 50, 50, 0.9);
    border-bottom: 1px solid rgba(50, 50, 50, 0.9);
    transition: background 0.2s ease;
    cursor: pointer;
}

.record-row:hover {
    background: rgba(38, 38, 38, 0.6);
}

.record-row.expanded {
    background: rgba(255, 140, 0, 0.1);
}

.record-row.cheated-record .rank-cell,
.record-row.cheated-record .rank-text,
.record-row.cheated-record .player-cell,
.record-row.cheated-record .player-name,
.record-row.cheated-record .time-cell,
.record-row.cheated-record .date-cell {
    color: #ff6b6b !important;
    font-style: italic;
}

.record-row td {
    padding: 3px 10px;
    font-size: 1.3rem;
    color: #ffffff;
    vertical-align: middle;
}

.rank-cell {
    text-align: center;
    font-weight: 400;
    color: #ff8c00;
}

.rank-medal {
    height: 30px;
    width: auto;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    display: inline-block;
}

.rank-text {
    color: #ffffff;
    font-weight: 400;
}

.player-cell {
    white-space: nowrap;
}

.player-flag {
    height: 30px;
    width: auto;
    margin-right: 0px;
    vertical-align: middle;
    display: inline-block;
}

.player-name {
    color: #ffffff;
    font-weight: 400;
    vertical-align: middle;
}

.time-cell,
.date-cell {
    text-align: center;
    font-weight: 400;
}

.untrusted {
    color: #ff6b6b;
    font-weight: 400;
}

.tags-cell {
    text-align: center;
    white-space: nowrap;
}

.tags-cell .record-tag {
    margin: 2px;
}

.record-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    vertical-align: middle;
}

.tag-legit {
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.tag-cheated {
    background: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.tag-streamed {
    background: rgba(33, 150, 243, 0.3);
    color: #2196f3;
}

.no-tags {
    color: #666;
    font-style: italic;
}

.expand-cell {
    text-align: center;
}

.expand-btn {
    background: transparent;
    border: none;
    color: #ff8c00;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s ease;
}

.expand-btn:hover {
    color: #ffa500;
}

.expand-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Expanded Details Row */
.expanded-details {
    background: rgba(255, 140, 0, 0.05);
    border-bottom: 1px solid rgba(255, 140, 0, 0.3);
}

.expanded-details td {
    padding: 0;
}

.details-content {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-section {
    display: flex;
    gap: 10px;
}

.detail-label {
    color: #ff8c00;
    font-weight: 700;
    min-width: 80px;
}

.detail-value {
    color: #ffffff;
    flex: 1;
}

.detail-link {
    color: #2196f3;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.detail-link:hover {
    color: #64b5f6;
    text-decoration: underline;
}

/* Cheaters Toggle Button */
.cheaters-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.cheaters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(100, 100, 100, 0.3);
    border: 2px solid #666;
    border-radius: 20px;
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cheaters-toggle:hover {
    background: rgba(150, 150, 150, 0.3);
    border-color: #888;
    color: #bbb;
}

.cheaters-toggle.active {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    color: #f44336;
}

.cheaters-toggle.active:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #ff5252;
    color: #ff5252;
}

.toggle-icon {
    font-size: 1.1rem;
}

.toggle-text {
    font-weight: 600;
}

/* Tags in expanded details - only visible on mobile */
.mobile-tags {
    display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .expand-header {
        max-width: 10px;
    }
    .expand-cell {
        max-width: 30px;
    }

    .map-detail-layout {
        grid-template-columns: 350px 1fr;
        gap: 20px;
    }

    .map-title {
        font-size: 1.6rem;
    }

    .records-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 992px) {
    .map-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .map-info-section {
        max-width: 600px;
        margin: 0 auto;
    }

}

@media (max-width: 768px) {
    .player-name {
        color: #ffffff;
        font-size: 1.3rem;
;
    }
    /* Hide tags column on mobile - shown in expanded details instead */
    .tags-header,
    .tags-cell {
        display: none;
    }

    .mobile-tags {
        display: flex;
    }
}

@media (max-width: 480px) {
    .stat-flag {
        height: 20px;
        margin-right: 2px;
    }

    .records-table th {
        padding: 2px 0px;
        font-size: 0.85rem;
    }

    .record-row td {
        padding: 0px 5px;
        font-size: 0.85rem;
    }

    .player-cell {
        gap: 2px;
    }

    .player-name {
        font-size: 13px;
    }

    .rank-medal {
        height: 20px;
        overflow: hidden;
    }

    .player-flag {
        height: 17px;
    }

    .record-tag {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .details-content {
        padding: 12px 15px;
    }

    .detail-section {
        flex-direction: column;
        gap: 5px;
    }

    .detail-label {
        min-width: auto;
    }
}
