/**
 * Fishing Leaderboard Front-End CSS - SLEEK COMPACT VERSION
 * PrestaShop 1.6.1.10 Compatible
 * Horizontal one-line layout for displaying more records
 */

/* ============================================
   EXISTING STYLES (Container, Headers, etc)
   ============================================ */

.fishing-leaderboard-container {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: -50px;
    padding: 5px;
}

.fishing-leaderboard-container h1.page-heading {
    color: #7851a9;
    font-size: 2.5em;
    margin-bottom: 10px!important;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.fishing-leaderboard-container h3.page-heading {
    color: #7851a9;
    margin-bottom: 5px!important;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.fishing-leaderboard-container .subtitle {
    color: #999;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 40px;
    padding: 0 10px;
}

.leaderboard-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leaderboard-section.champion-section {
    border-color: #7851a9;
    border-width: 2px;
}

.leaderboard-section.latest-competition-section {
    border-color: #e74c3c;
    border-width: 3px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
}

.latest-competition-section .section-header {
    border-bottom-color: #e74c3c;
}

.latest-competition-section .section-header h2 {
    color: #e74c3c;
}

.latest-competition-section .competition-date {
    background: #e74c3c;
    color: #fff!important;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.latest-competition-section .competition-date i {
    margin-right: 5px;
}

.leaderboard-section.all-time {
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}

.section-header {
    margin-bottom: 20px;
    padding: 10px;
    padding-bottom: 15px;
    border-bottom: 3px solid #7851a9;
}

.section-header h2 {
    color: #7851a9;
    font-size: 1.8em;
    margin: 0;
    display: inline-block;
}

.section-header .date-range {
    color: #666;
    font-size: 1.1em;
    margin-left: 15px;
}

/* ============================================
   TABLE STYLES (for columns_per_row = 1)
   ============================================ */

.leaderboard-table {
    width: 100%;
    margin-top: 15px;
    table-layout: auto;
}

.leaderboard-table thead tr.header-row {
    background: #7851a9;
    color: #fff;
}

.leaderboard-table thead th {
    padding: 15px 10px;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #5c3d82;
    white-space: wrap;
}

.leaderboard-table tbody tr {
    transition: background-color 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background-color: #f9f9f9;
}

.leaderboard-table tbody tr.champion-row {
    background: linear-gradient(90deg, #fff9e6 0%, #ffffff 100%);
    font-weight: bold;
}

.leaderboard-table tbody tr.podium-row {
    background-color: #f5f5f5;
}

.leaderboard-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #e5e5e5;
    word-wrap: break-word;
}

.rank-col {
    width: 80px;
    text-align: center;
}

.rank-badge {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 1.2em;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    color: #333;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.5);
    color: #333;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.5);
    color: #fff;
}

.rank-number {
    font-size: 1.3em;
    font-weight: bold;
    color: #666;
}

.angler-col {
    min-width: 150px;
    font-size: 1.1em;
}

.angler-col strong {
    color: #333;
}

.weight-col {
    text-align: right;
    min-width: 100px;
}

.weight-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #27ae60;
    display: inline-block;
    text-align: right;
}

.species-col {
    min-width: 120px;
    color: #555;
}

.species-col em {
    font-style: italic;
    color: #7851a9;
}

.image-col {
    width: 100px;
    text-align: center;
}

.entry-thumbnail {
    max-width: 80px;
    max-height: 60px;
    border-radius: 4px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.entry-thumbnail:hover {
    transform: scale(1.5);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.empty-image {
    font-size: 2em;
    color: #ccc;
}

.image-col .icon-camera {
    display: inline-block;
    width: 32.15px;
    font-size: 32px;
    color: #ccc;
    text-align: center;
}

/* ============================================
   SLEEK COMPACT GRID LAYOUT (NEW)
   Everything in one horizontal line
   ============================================ */

.leaderboard-grid-compact {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

/* 2 Column Layout */
.leaderboard-grid-compact.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 Column Layout */
.leaderboard-grid-compact.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Compact Card - Horizontal Layout */
.leaderboard-card-compact {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 5px 5px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-height: 60px;
}

.leaderboard-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Champion and Podium Styling */
.leaderboard-card-compact.champion-card {
    border-color: #ffd700;
    border-width: 3px;
    background: linear-gradient(90deg, #fff9e6 0%, #ffffff 100%);
    margin: 5px;
}

.leaderboard-card-compact.podium-card {
    border-color: #c0c0c0;
    background: linear-gradient(90deg, #f9f9f9 0%, #ffffff 100%);
    margin: 5px;
}

/* Rank Section (Left side) */
.leaderboard-card-compact .rank-section {
    flex-shrink: 0;
    margin-right: 15px;
}

.rank-badge-compact {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.rank-badge-compact.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.rank-badge-compact.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.rank-badge-compact.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    color: #fff;
}

.rank-badge-compact.default {
    background: linear-gradient(135deg, #888 0%, #aaa 100%);
    color: #fff;
}

/* Info Section (Middle - expands to fill space) */
.leaderboard-card-compact .info-section {
    flex: 1;
    min-width: 0;
    margin-right: 15px;
}

.leaderboard-card-compact .name-primary {
    font-size: 1.05em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-card-compact .name-primary strong {
    color: #333;
}

.leaderboard-card-compact .info-secondary {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-card-compact .info-secondary .field-item {
    margin-right: 10px;
    display: inline-block;
}

.leaderboard-card-compact .info-secondary .field-item:last-child {
    margin-right: 0;
}

/* Weight Section (Right side - prominent) */
.leaderboard-card-compact .weight-section {
    flex-shrink: 0;
    text-align: right;
    margin-right: 15px;
}

.leaderboard-card-compact .weight-value-compact {
    font-size: 1.4em;
    font-weight: bold;
    color: #27ae60;
    line-height: 1.2;
}

.leaderboard-card-compact .weight-label-compact {
    font-size: 0.75em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Image Section (Far right - optional) */
.leaderboard-card-compact .image-section {
    flex-shrink: 0;
}

.leaderboard-card-compact .thumbnail-compact {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #ddd;
}

/* ============================================
   WINNER ANIMATIONS (apply to compact cards)
   ============================================ */

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes glow-gold {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

@keyframes glow-silver {
    0%, 100% {
        box-shadow: 0 0 5px rgba(192, 192, 192, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(192, 192, 192, 1), 0 0 30px rgba(192, 192, 192, 0.6);
    }
}

@keyframes glow-bronze {
    0%, 100% {
        box-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(205, 127, 50, 1), 0 0 30px rgba(205, 127, 50, 0.6);
    }
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Apply animations to table rows */
.leaderboard-table tbody tr.winner-first {
    animation: flash 1.5s ease-in-out infinite, glow-gold 1.5s ease-in-out infinite !important;
}

.leaderboard-table tbody tr.winner-second {
    animation: flash 1.5s ease-in-out infinite 0.25s, glow-silver 1.5s ease-in-out infinite 0.25s !important;
}

.leaderboard-table tbody tr.winner-third {
    animation: flash 1.5s ease-in-out infinite 0.5s, glow-bronze 1.5s ease-in-out infinite 0.5s !important;
}

/* Apply animations to compact cards */
.leaderboard-card-compact.champion-card {
    animation: flash 1.5s ease-in-out infinite, glow-gold 1.5s ease-in-out infinite;
}

/* First podium card (rank 2) */
.leaderboard-grid-compact .leaderboard-card-compact.podium-card:first-of-type {
    animation: flash 1.5s ease-in-out infinite 0.25s, glow-silver 1.5s ease-in-out infinite 0.25s;
}

/* Animate rank badges */
.rank-badge-compact {
    animation: pulse-badge 1.5s ease-in-out infinite !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet - Convert to single column */
@media (max-width: 768px) {
    .fishing-leaderboard-container {
        padding: 10px;
    }
    
    .fishing-leaderboard-container h1.page-heading {
        font-size: 2em;
    }
    
    .leaderboard-section {
        padding: 15px 10px;
    }
    
    .section-header h2 {
        font-size: 1.5em;
    }
    
    /* Grid becomes single column */
    .leaderboard-grid-compact.columns-2,
    .leaderboard-grid-compact.columns-3 {
        grid-template-columns: 1fr;
    }
    
    /* Table adjustments */
    .leaderboard-table {
        font-size: 0.95em;
    }
    
    .leaderboard-table thead th,
    .leaderboard-table tbody td {
        padding: 8px 6px;
        font-size: 0.95em;
    }
}

/* Mobile - Optimize compact cards */
@media (max-width: 576px) {
    .fishing-leaderboard-container {
        padding: 5px;
    }
    
    .fishing-leaderboard-container h1.page-heading {
        font-size: 1.6em;
    }
    
    .leaderboard-section {
        padding: 12px 8px;
    }
    
    /* Compact cards for mobile */
    .leaderboard-grid-compact {
        gap: 10px;
    }
    
    .leaderboard-grid-compact.columns-2,
    .leaderboard-grid-compact.columns-3 {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-card-compact {
        padding: 10px 12px;
        min-height: 50px;
    }
    
    .leaderboard-card-compact .rank-section {
        margin-right: 10px;
    }
    
    .rank-badge-compact {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 1em;
    }
    
    .leaderboard-card-compact .info-section {
        margin-right: 10px;
    }
    
    .leaderboard-card-compact .name-primary {
        font-size: 0.95em;
    }
    
    .leaderboard-card-compact .info-secondary {
        font-size: 0.8em;
    }
    
    .leaderboard-card-compact .weight-section {
        margin-right: 10px;
    }
    
    .leaderboard-card-compact .weight-value-compact {
        font-size: 1.2em;
    }
    
    .leaderboard-card-compact .weight-label-compact {
        font-size: 0.7em;
    }
    
    .leaderboard-card-compact .thumbnail-compact {
        width: 40px;
        height: 40px;
    }
    
    /* Hide image on very small screens to save space */
    .leaderboard-card-compact .image-section {
        display: none;
    }
    
    /* Show only essential secondary info */
    .leaderboard-card-compact .info-secondary .field-item:nth-child(n+3) {
        display: none;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .leaderboard-card-compact {
        padding: 8px 10px;
    }
    
    .rank-badge-compact {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 0.9em;
    }
    
    .leaderboard-card-compact .name-primary {
        font-size: 0.9em;
    }
    
    .leaderboard-card-compact .weight-value-compact {
        font-size: 1.1em;
    }
}

/* ============================================
   MY FISHING RECORDS PAGE STYLES
   ============================================ */

.fishing-myrecord-page {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
}

.fishing-myrecord-page h1.page-heading {
    color: #7851a9;
    font-size: 2em;
    margin-bottom: 5px;
    padding: 10px;
    border-bottom: 3px solid #7851a9;
}

.fishing-myrecord-page .myrecord-header {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.fishing-myrecord-page .info-customer {
    margin: 0;
    font-size: 1.1em;
    color: #555;
}

.fishing-myrecord-page .myrecord-table {
    width: 100%;
    margin-top: 15px;
}

.fishing-myrecord-page .myrecord-table thead tr.header-row {
    background: #7851a9;
    color: #fff;
}

.fishing-myrecord-page .myrecord-table thead th {
    padding: 12px 10px;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #5c3d82;
}

.fishing-myrecord-page .myrecord-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

.fishing-myrecord-page .myrecord-table thead th.sortable:hover {
    background-color: #6a4799;
}

.fishing-myrecord-page .myrecord-table thead th .sort-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.fishing-myrecord-page .myrecord-table thead th.sortable:hover .sort-icon {
    opacity: 1;
}

.fishing-myrecord-page .myrecord-table thead th.sort-asc .sort-icon i:before {
    content: "\f0d8";
    opacity: 1;
}

.fishing-myrecord-page .myrecord-table thead th.sort-desc .sort-icon i:before {
    content: "\f0d7";
    opacity: 1;
}

.fishing-myrecord-page .myrecord-table thead th.sort-asc .sort-icon,
.fishing-myrecord-page .myrecord-table thead th.sort-desc .sort-icon {
    opacity: 1;
    color: #ffd700;
}

.fishing-myrecord-page .myrecord-table tbody tr {
    transition: background-color 0.3s ease;
}

.fishing-myrecord-page .myrecord-table tbody tr:hover {
    background-color: #f9f9f9;
}

.fishing-myrecord-page .myrecord-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #e5e5e5;
}

.fishing-myrecord-page .date-col {
    min-width: 120px;
    text-align: center;
}

.fishing-myrecord-page .date-col strong {
    color: #333;
    font-size: 1em;
}

.fishing-myrecord-page .footer_links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.fishing-myrecord-page .icon-trophy {
    margin-right: 8px;
    color: #7851a9;
}

.fishing-myrecord-page .alert-warning {
    padding: 20px;
    font-size: 1.1em;
}

.fishing-myrecord-page .alert-warning i {
    margin-right: 8px;
}

/* My Records responsive */
@media (max-width: 768px) {
    .fishing-myrecord-page {
        padding: 10px 5px;
    }
    
    .fishing-myrecord-page h1.page-heading {
        font-size: 1.6em;
    }
    
    .fishing-myrecord-page .myrecord-table {
        font-size: 0.95em;
    }
}

@media (max-width: 576px) {
    .fishing-myrecord-page .myrecord-table {
        font-size: 0.9em;
    }
    
    .fishing-myrecord-page .field5-col {
        display: none;
    }
}
