/* Main container */
.psn-trophy-container {
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Summary section */
.psn-trophy-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Summary section without title */
.psn-trophy-summary h3 {
    display: none;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.stat {
    text-align: center;
    min-width: 100px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Trophy icons in summary */
.trophy-count-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* Trophy colors */
.trophy-platinum-lightblue { color: #00bfff; } 
.trophy-gold { color: #ffd700; }
.trophy-silver { color: #c0c0c0; }
.trophy-bronze { color: #cd7f32; }

/* Total trophies icon */
.total-trophies .fa-trophy {
    color: #ff6b6b;
}

/* Table styles */
.psn-trophy-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.psn-trophy-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.psn-trophy-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.psn-trophy-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.psn-trophy-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.psn-trophy-table tbody tr:hover {
    background-color: #f8f9fa;
}

.psn-trophy-table tbody tr:last-child td {
    border-bottom: none;
}

/* Trophy type cells */
.trophy-icon-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.trophy-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #dee2e6;
}

.trophy-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.trophy-name {
    font-weight: 600;
    color: #212529;
}

/* Hidden trophy indicator */
.trophy-hidden-badge {
    color: #6c757d;
    font-size: 0.85em;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.trophy-hidden-badge:hover {
    opacity: 1;
}

.trophy-hidden-badge i {
    font-size: 0.9em;
}

.game-title {
    color: #6c757d;
    font-size: 0.9rem;
}

.trophy-desc {
    color: #495057;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Trophy type icons - plain without background/text */
.trophy-type-icon {
    width: 24px;
    height: 24px;
    display: block;
    margin: 0 auto;
}

/* Remove old trophy badge styling */
.trophy-badge {
    display: none;
}

.trophy-type {
    text-align: center;
    width: 75px;
    padding-left: 20px;
}

/* Status indicators */
.status-earned {
    color: #28a745;
    display: block;
}

.status-earned i {
    margin-right: 0.5rem;
}

.status-unearned {
    color: #6c757d;
    display: block;
}

.status-unearned i {
    margin-right: 0.5rem;
}

/* Rarity meter */
.rarity-meter {
    position: relative;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.rarity-bar {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
}

.rarity-value {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Remove pagination for table layout */
.psn-table-layout .psn-trophy-pagination {
    display: none;
}

/* Keep pagination for grid layout */
.psn-grid-layout .psn-trophy-pagination {
    display: block;
    margin-top: 2rem;
    text-align: center;
}

.pagination-nav .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 4px;
    padding: 0 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-nav .page-numbers.current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-nav .page-numbers:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

/* Grid layout - Game trophies */
.psn-grid-layout .game-header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.psn-grid-layout .game-header-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.75rem;
}

.game-stats-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.psn-grid-layout .psn-trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.trophy-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #dee2e6;
}

.trophy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Trophy card border colors based on type */
.trophy-card-platinum {
    border-top-color: #00bfff;
}
.trophy-card-gold {
    border-top-color: #ffd700;
}
.trophy-card-silver {
    border-top-color: #c0c0c0;
}
.trophy-card-bronze {
    border-top-color: #cd7f32;
}

.trophy-card-header {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.trophy-card-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.trophy-card-icon-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #6c757d;
    font-size: 2rem;
}

.trophy-card-type {
    position: absolute;
    bottom: -20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.trophy-card-type img.trophy-type-icon {
    width: 30px;
    height: 30px;
}

.trophy-card-body {
    padding: 2rem 1.5rem 1.5rem;
}

.trophy-card-title {
    margin: 0 0 0.5rem;
    color: #212529;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    min-height: 2.5rem;
}

.trophy-card-type-badge {
    display: none;
}

.trophy-card-desc {
    color: #495057;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    min-height: 4rem;
}

.trophy-hidden-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: #f8f9fa;
    border-radius: 20px;
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.trophy-hidden-indicator i {
    color: #ff6b6b;
}

.trophy-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.75rem;
    color: #6c757d;
}

.meta-rarity, .meta-reward {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-rarity i { color: #4facfe; }
.meta-reward i { color: #ff6b6b; }

/* Language note */
.psn-language-note {
    margin-top: 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

.psn-language-note i {
    margin-right: 0.5rem;
}

/* Error message */
.psn-trophy-error {
    padding: 1rem;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    text-align: center;
}

.psn-trophy-error i {
    margin-right: 0.5rem;
}

/* Loading state */
.psn-trophy-loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.psn-trophy-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #007bff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Trophy group headers in table */
.trophy-group-header {
    background: #f8f9fa !important;
    border-left: 4px solid #007bff;
}

.group-header-cell {
    padding: 0.75rem 1rem !important;
    background: linear-gradient(to right, rgba(0, 123, 255, 0.1), transparent);
}

.trophy-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #495057;
    position: relative;
}

.trophy-group-title i {
    color: #007bff;
    font-size: 1.25rem;
}

.trophy-group-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Group Icons */
.group-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* Space between multiple icons */
.group-icon.ps4-icon + .group-icon.ps5-icon {
    margin-left: 8px;
}

/* Icon colors */
.group-icon.ps4-icon {
    filter: brightness(0.9);
}

.group-icon.ps5-icon {
    filter: brightness(1.1);
}

.group-icon.dlc-icon {
    filter: brightness(0.8);
}

/* Remove the default font icon style for game trophies when icons are present */
.trophy-group-title .fa-layer-group {
    display: none;
}

.group-total-badge-container {
    margin-left: auto;
    position: relative;
}

.group-total-toggle {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.group-total-toggle:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.group-total-toggle:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

.group-total-toggle .toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    line-height: 1;
}

/* Dropdown styling - FIXED: No animation/transition on display property */
.group-breakdown-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    margin-top: 8px;
    padding: 16px;
    /* Removed animation to prevent jump */
    display: none; /* Start hidden */
}

/* Show dropdown without animation */
.group-breakdown-dropdown.show {
    display: block;
}

.breakdown-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #495057;
    text-align: center;
}

.breakdown-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.breakdown-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.breakdown-type {
    flex-grow: 1;
    font-size: 0.875rem;
    color: #495057;
}

.breakdown-count {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* Type-specific colors for breakdown */
.breakdown-platinum .breakdown-type { color: #00bfff; }
.breakdown-gold .breakdown-type { color: #ffd700; }
.breakdown-silver .breakdown-type { color: #c0c0c0; }
.breakdown-bronze .breakdown-type { color: #cd7f32; }

/* Styling for trophies in DLC groups */
tr[data-group="001"] .trophy-name::before,
tr[data-group="002"] .trophy-name::before,
tr[data-group="003"] .trophy-name::before,
tr[data-group="004"] .trophy-name::before,
tr[data-group="005"] .trophy-name::before {
    content: "DLC • ";
    color: #6c757d;
    font-size: 0.75rem;
    margin-right: 4px;
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .summary-stats {
        gap: 1rem;
    }
    
    .stat {
        min-width: 80px;
        padding: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Adjust table for removed Rarity column */
    .psn-trophy-table th:nth-child(6),
    .psn-trophy-table td:nth-child(6) {
        display: none;
    }
    
    .trophy-icon {
        width: 40px;
        height: 40px;
    }
    
    .psn-grid-layout .psn-trophy-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .game-stats-summary {
        gap: 1rem;
    }
    
    .game-stats-summary .stat {
        min-width: 70px;
        padding: 0.5rem;
    }
    
    /* Mobile adjustments for group headers */
    .trophy-group-title {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .group-total-badge-container {
        margin-left: 0;
        width: 100%;
        order: 3;
    }
    
    .group-total-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .group-breakdown-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
        max-height: 80vh;
        overflow-y: auto;
        margin-top: 0;
    }
    
    .trophy-type {
        width: 70px;
        padding-left: 10px;
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .psn-grid-layout .psn-trophy-grid {
        grid-template-columns: 1fr;
    }
    
    .game-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile adjustments for trophy cells */
    .trophy-icon-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .trophy-name-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .trophy-hidden-badge {
        align-self: flex-start;
    }
}