/* ==========================================================================
   Hall of Fame Frontend Styles - Dark Mode Edition con Sistema de Rangos
   ========================================================================== */

/* Variables CSS - Modo Oscuro */
:root {
    /* Colores base modo oscuro */
    --thof-bg-primary: #1e1e1e;
    --thof-bg-secondary: #2d2d30;
    --thof-bg-tertiary: #3c3c3c;
    --thof-bg-card: #252526;
    
    /* Textos */
    --thof-text-primary: #ffffff;
    --thof-text-secondary: #cccccc;
    --thof-text-muted: #999999;
    
    /* Colores de acento */
    --thof-primary: #0078d4;
    --thof-primary-dark: #106ebe;
    --thof-secondary: #00a96e;
    --thof-accent: #ff6b35;
    
    /* Medallas */
    --thof-gold: #ffd700;
    --thof-silver: #c0c0c0;
    --thof-bronze: #cd7f32;
    
    /* Rangos */
    --thof-rank-novato: #4ade80;
    --thof-rank-veterano: #3b82f6;
    --thof-rank-elite: #8b5cf6;
    --thof-rank-profesional: #f59e0b;
    --thof-rank-maestro: #ef4444;
    --thof-rank-gran-maestro: #ec4899;
    --thof-rank-legendario: #fbbf24;
    
    /* Bordes y sombras */
    --thof-border: #444444;
    --thof-border-light: #555555;
    --thof-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --thof-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
    --thof-shadow-glow: 0 0 20px rgba(0, 120, 212, 0.3);
    
    /* Gradientes */
    --thof-gradient-primary: linear-gradient(135deg, var(--thof-bg-secondary), var(--thof-bg-tertiary));
    --thof-gradient-card: linear-gradient(145deg, var(--thof-bg-card), #2a2a2b);
    --thof-gradient-accent: linear-gradient(45deg, var(--thof-primary), var(--thof-secondary));
}

/* Contenedores principales */
.thof-title {
    margin: 0 0 24px 0;
    font-size: 28px;
    font-weight: 700;
    background: #22c55e;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    border-bottom: 3px solid var(--thof-border);
    padding-bottom: 16px;
    position: relative;
}

.thof-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--thof-gradient-accent);
    border-radius: 2px;
}

/* ==========================================================================
   Buscador del Leaderboard
   ========================================================================== */

.thof-search-container {
    margin-bottom: 24px;
    position: relative;
}

.thof-search-box {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.thof-search-input {
    width: 90%;
    padding: 12px 45px 12px 16px;
    background: var(--thof-bg-card);
    border: 2px solid var(--thof-border);
    border-radius: 25px;
    color: var(--thof-text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.thof-search-input:focus {
    border-color: var(--thof-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.thof-search-input::placeholder {
    color: var(--thof-text-muted);
}

.thof-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--thof-text-muted);
    pointer-events: none;
}

.thof-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--thof-bg-card);
    border: 1px solid var(--thof-border);
    border-radius: 12px;
    box-shadow: var(--thof-shadow);
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.thof-search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--thof-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.thof-search-result-item:last-child {
    border-bottom: none;
}

.thof-search-result-item:hover {
    background: var(--thof-bg-tertiary);
}

.thof-search-result-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thof-search-result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.thof-search-result-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thof-search-result-position {
    background: var(--thof-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.thof-search-result-name {
    color: var(--thof-text-primary);
    font-weight: 500;
}

.thof-search-result-points {
    color: var(--thof-text-muted);
    font-size: 14px;
}

.thof-search-result-rank {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
}

.rank-header-search {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rank-image-search {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
}

.rank-emoji-search {
    font-size: 16px;
    line-height: 1;
}

.rank-name-search {
    font-size: 11px;
    color: var(--thof-text-secondary);
    font-weight: 500;
}

.rank-progress-search {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rank-progress-bar-search {
    flex: 1;
    height: 3px;
    background: var(--thof-bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.rank-progress-fill-search {
    height: 100%;
    background: linear-gradient(90deg, var(--thof-secondary), var(--thof-primary));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.rank-progress-text-search {
    font-size: 9px;
    color: var(--thof-text-muted);
    font-weight: 500;
    min-width: 25px;
    text-align: right;
}

.thof-search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--thof-text-muted);
}

/* ==========================================================================
   Cards System
   ========================================================================== */

.thof-card {
    background: var(--thof-gradient-card);
    border: 1px solid var(--thof-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--thof-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.thof-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--thof-gradient-accent);
    border-radius: 12px 12px 0 0;
}

.thof-card:hover {
    box-shadow: var(--thof-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--thof-primary);
}

/* ==========================================================================
   Leaderboard Styles
   ========================================================================== */

.thof-leaderboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.thof-user-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.thof-user-card[data-position="1"] {
    border-color: var(--thof-gold);
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), var(--thof-bg-card));
    box-shadow: var(--thof-shadow), 0 0 20px rgba(255, 215, 0, 0.2);
}

.thof-user-card[data-position="1"]::before {
    background: linear-gradient(90deg, var(--thof-gold), #ffed4e);
}

.thof-user-card[data-position="2"] {
    border-color: var(--thof-silver);
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.1), var(--thof-bg-card));
    box-shadow: var(--thof-shadow), 0 0 20px rgba(192, 192, 192, 0.2);
}

.thof-user-card[data-position="2"]::before {
    background: linear-gradient(90deg, var(--thof-silver), #e5e5e5);
}

.thof-user-card[data-position="3"] {
    border-color: var(--thof-bronze);
    background: linear-gradient(145deg, rgba(205, 127, 50, 0.1), var(--thof-bg-card));
    box-shadow: var(--thof-shadow), 0 0 20px rgba(205, 127, 50, 0.2);
}

.thof-user-card[data-position="3"]::before {
    background: linear-gradient(90deg, var(--thof-bronze), #e4a853);
}

.thof-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--thof-border);
}

.thof-medal {
    font-size: 17px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
    to { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) brightness(1.1); }
}

.thof-position {
    font-weight: 700;
    font-size: 18px;
    color: var(--thof-primary);
    background: rgba(0, 120, 212, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--thof-primary);
}

.thof-card-body {
    display: flex;
    align-items: center;
    gap: 20px;
}

.thof-avatar {
    flex-shrink: 0;
    position: relative;
}

.thof-avatar-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--thof-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.thof-avatar:hover .thof-avatar-img {
    transform: scale(1.05);
    border-color: var(--thof-primary);
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.3);
}

.thof-user-info {
    flex: 1;
}

.thof-username {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--thof-text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.thof-actions {
    font-size: 14px;
    color: var(--thof-text-secondary);
    font-weight: 500;
}

/* Leaderboard minimal */
.thof-leaderboard-minimal {
    background: var(--thof-gradient-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--thof-shadow);
    border: 1px solid var(--thof-border);
}

.thof-minimal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--thof-border);
    transition: all 0.3s ease;
}

.thof-minimal-row:last-child {
    border-bottom: none;
}

.thof-minimal-row:hover {
    background: rgba(0, 120, 212, 0.05);
    border-radius: 8px;
    padding-left: 12px;
    padding-right: 12px;
}

.thof-minimal-row .thof-position {
    font-size: 20px;
    font-weight: 700;
    min-width: 50px;
    color: var(--thof-primary);
    text-align: center;
}

.thof-minimal-row .thof-username {
    flex: 1;
    margin: 0 20px;
    font-weight: 600;
    color: var(--thof-text-primary);
}

.thof-minimal-row .thof-points {
    font-weight: 700;
    color: var(--thof-primary);
    background: rgba(0, 120, 212, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--thof-primary);
}

/* ==========================================================================
   Table Styles
   ========================================================================== */

.thof-table-container {
    background: #191c23;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--thof-shadow);
    margin-top: 24px;
    border: 1px solid var(--thof-border);
    /* Scroll horizontal suave para móviles */
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Indicador de scroll horizontal para móviles */
@media (max-width: 768px) {
    .thof-table-container::after {
        content: "← Desliza para ver más →";
        position: absolute;
        bottom: 5px;
        right: 10px;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 10px;
        pointer-events: none;
        opacity: 0.7;
        z-index: 10;
    }
}

.thof-table {
    width: 100%;
    min-width: 600px; /* Ancho mínimo para scroll horizontal */
    border-collapse: collapse;
    margin: 0;
    background: transparent;
}

.thof-table th {
    background: #22c55e;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 700;
    border: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.thof-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--thof-border);
    vertical-align: middle;
    color: var(--thof-text-primary);
    background: transparent;
}

/* Estilos específicos para columnas */
.thof-position {
    text-align: center;
    width: 8%;
    padding: 8px 4px;
}

.thof-username {
    width: 15%;
    font-weight: 500;
    text-align: center;
}

.thof-rank {
    width: 25%;
}

.thof-points {
    width: 10%;
    text-align: center;
    font-weight: 600;
}

.thof-actions {
    width: 10%;
    text-align: center;
    color: var(--thof-text-secondary);
}

.thof-last-activity {
    width: 30%;
    text-align: center;
    font-size: 12px;
    color: var(--thof-text-muted);
}

.thof-table-row:hover {
    background: rgba(0, 120, 212, 0.05);
}

.thof-table-row[data-position="1"] {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
    border-left: 4px solid var(--thof-gold);
}

.thof-table-row[data-position="2"] {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
    border-left: 4px solid var(--thof-silver);
}

.thof-table-row[data-position="3"] {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
    border-left: 4px solid var(--thof-bronze);
}

.thof-mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    vertical-align: middle;
    border: 2px solid var(--thof-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Stats Styles
   ========================================================================== */

.thof-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.thof-stat-card {
    text-align: center;
    padding: 32px 24px;
    background: #191c23;
    border: 1px solid var(--thof-border);
    border-radius: 12px;
    box-shadow: var(--thof-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.thof-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--thof-gradient-accent);
}

.thof-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--thof-shadow-hover);
    border-color: var(--thof-primary);
}

.thof-stat-icon {
    font-size: 56px;
    margin-bottom: 20px;
    display: block;
    color: var(--thof-primary);
    filter: drop-shadow(0 4px 8px rgba(0, 120, 212, 0.3));
}

.thof-stat-value {
    font-size: 36px;
    font-weight: 700;
    background: var(--thof-gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 12px;
}

.thof-stat-label {
    font-size: 14px;
    color: var(--thof-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.thof-action-stats {
    margin-top: 32px;
}

.thof-action-stats h4 {
    margin-bottom: 24px;
    color: #22c55e;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
}

.thof-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.thof-action-stat {
    background: #191c23;
    border: 1px solid var(--thof-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--thof-shadow);
}

.thof-action-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--thof-shadow-hover);
    border-color: var(--thof-primary);
}

.thof-action-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
    color: var(--thof-primary);
}

.thof-action-label {
    font-size: 12px;
    color: var(--thof-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.thof-action-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--thof-primary);
    background: rgba(0, 120, 212, 0.1);
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid var(--thof-primary);
}

.thof-stats-minimal {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 24px;
    background: var(--thof-gradient-card);
    border-radius: 12px;
    box-shadow: var(--thof-shadow);
    border: 1px solid var(--thof-border);
}

.thof-mini-stat {
    background: var(--thof-bg-tertiary);
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--thof-text-primary);
    border: 1px solid var(--thof-border);
    transition: all 0.3s ease;
}

.thof-mini-stat:hover {
    background: var(--thof-primary);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================================================
   User Search Styles
   ========================================================================== */

.thof-search-form {
    background: var(--thof-gradient-card);
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--thof-shadow);
    border: 1px solid var(--thof-border);
}

.thof-search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.thof-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--thof-border);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.thof-search-input:focus {
    outline: none;
    border-color: var(--thof-primary);
}

.thof-search-button {
    padding: 12px 20px;
    background: var(--thof-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.thof-search-button:hover {
    background: var(--thof-primary-dark);
}

.thof-search-tips {
    font-size: 14px;
    color: var(--thof-text-light);
    text-align: center;
}

.thof-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: var(--thof-card-bg);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
}

.thof-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--thof-border);
    border-top: 2px solid var(--thof-primary);
    border-radius: 50%;
    animation: thof-spin 1s linear infinite;
}

@keyframes thof-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.thof-search-results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.thof-user-result-card {
    background: var(--thof-card-bg);
    border: 1px solid var(--thof-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--thof-shadow);
    transition: transform 0.2s ease;
}

.thof-user-result-card:hover {
    transform: translateY(-2px);
}

.thof-user-result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.thof-user-result-avatar {
    flex-shrink: 0;
}

.thof-result-avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--thof-border);
}

.thof-user-result-info {
    flex: 1;
}

.thof-user-result-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.thof-user-result-position {
    font-size: 14px;
    color: var(--thof-primary);
    font-weight: 500;
}

.thof-user-result-medal {
    font-size: 24px;
}

.thof-user-result-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid var(--thof-border);
}

.thof-result-stat {
    text-align: center;
}

.thof-result-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--thof-primary);
}

.thof-result-stat-label {
    font-size: 12px;
    color: var(--thof-text-light);
    margin-top: 2px;
}

.thof-no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--thof-card-bg);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
    color: var(--thof-text-light);
    font-size: 16px;
}

.thof-error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #fcc;
    text-align: center;
    font-weight: 500;
}

/* ==========================================================================
   Recent Activity Styles
   ========================================================================== */

.thof-activity-list {
    background: var(--thof-card-bg);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
    overflow: hidden;
}

.thof-activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--thof-border);
    transition: background-color 0.2s ease;
}

.thof-activity-item:last-child {
    border-bottom: none;
}

.thof-activity-item:hover {
    background: var(--thof-background);
}

.thof-activity-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.thof-activity-content {
    flex: 1;
}

.thof-activity-user {
    font-weight: 500;
    margin-bottom: 3px;
}

.thof-activity-action {
    font-size: 14px;
    color: var(--thof-text-light);
    margin-bottom: 2px;
}

.thof-activity-time {
    font-size: 12px;
    color: var(--thof-text-light);
}

.thof-activity-points {
    flex-shrink: 0;
}

.thof-points-badge {
    background: var(--thof-secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.thof-activity-footer {
    text-align: center;
    padding: 15px;
    background: var(--thof-background);
    border-top: 1px solid var(--thof-border);
    color: var(--thof-text-light);
}

.thof-no-activity {
    text-align: center;
    padding: 60px 20px;
    background: var(--thof-card-bg);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
}

.thof-no-activity-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.thof-no-activity-text {
    color: var(--thof-text-light);
    font-size: 16px;
}

/* ==========================================================================
   My Position Styles
   ========================================================================== */

.thof-position-card {
    background: var(--thof-card-bg);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
    overflow: hidden;
}

.thof-position-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, var(--thof-primary) 0%, var(--thof-primary-dark) 100%);
    color: white;
}

.thof-position-medal {
    font-size: 48px;
}

.thof-position-info {
    flex: 1;
}

.thof-position-user {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.thof-position-rank {
    font-size: 16px;
    opacity: 0.9;
}

.thof-position-avatar {
    flex-shrink: 0;
}

.thof-position-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.thof-position-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 25px;
}

.thof-position-stat {
    text-align: center;
    padding: 20px;
    background: var(--thof-background);
    border-radius: 6px;
}

.thof-position-stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.thof-position-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--thof-primary);
    display: block;
    margin-bottom: 5px;
}

.thof-position-stat-label {
    font-size: 12px;
    color: var(--thof-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thof-position-progress {
    padding: 25px;
    border-top: 1px solid var(--thof-border);
}

.thof-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.thof-progress-title {
    font-weight: 600;
    color: var(--thof-text);
}

.thof-progress-points {
    font-size: 14px;
    color: var(--thof-text-light);
}

.thof-progress-bar {
    height: 10px;
    background: var(--thof-border);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.thof-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--thof-secondary) 0%, var(--thof-primary) 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.thof-progress-remaining {
    text-align: center;
    font-size: 14px;
    color: var(--thof-text-light);
}

.thof-position-achievement {
    padding: 25px;
    text-align: center;
    border-top: 1px solid var(--thof-border);
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.thof-achievement-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.thof-achievement-text {
    font-size: 16px;
    color: var(--thof-text);
}

.thof-position-actions {
    display: flex;
    gap: 15px;
    padding: 25px;
    justify-content: center;
}

.thof-button {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.thof-button-primary {
    background: var(--thof-primary);
    color: white;
}

.thof-button-primary:hover {
    background: var(--thof-primary-dark);
    color: white;
    text-decoration: none;
}

.thof-button-secondary {
    background: var(--thof-background);
    color: var(--thof-text);
    border: 1px solid var(--thof-border);
}

.thof-button-secondary:hover {
    background: var(--thof-border);
    color: var(--thof-text);
    text-decoration: none;
}

.thof-user-not-found {
    text-align: center;
    padding: 60px 20px;
    background: var(--thof-card-bg);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
}

.thof-not-found-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.thof-not-found-text {
    font-size: 18px;
    color: var(--thof-text);
    margin-bottom: 10px;
    font-weight: 500;
}

.thof-not-found-subtitle {
    color: var(--thof-text-light);
    font-size: 14px;
}

/* ==========================================================================
   Points Table Styles
   ========================================================================== */

.thof-points-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.thof-points-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--thof-card-bg);
    border: 1px solid var(--thof-border);
    border-radius: 6px;
    box-shadow: var(--thof-shadow);
    transition: transform 0.2s ease;
}

.thof-points-item:hover {
    transform: translateY(-2px);
}

.thof-action-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.thof-action-name {
    flex: 1;
    font-weight: 500;
}

.thof-action-points {
    font-weight: 600;
    color: var(--thof-secondary);
    font-size: 16px;
}

.thof-points-config-table .thof-action-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thof-points-config-table .thof-action-icon {
    font-size: 18px;
}

.thof-points-config-table .thof-description-cell {
    color: var(--thof-text-light);
    font-size: 14px;
}

.thof-points-config-table .thof-points-cell {
    text-align: center;
}

.thof-points-value {
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Puntos positivos (por defecto) */
.thof-points-value.positive,
.thof-points-value:not(.negative) {
    background: var(--thof-secondary);
}

/* Puntos negativos */
.thof-points-value.negative {
    background: var(--thof-accent);
    color: white;
}

.thof-milestones {
    margin-top: 30px;
}

.thof-milestones-title {
    text-align: center;
    margin-bottom: 25px;
    color: var(--thof-primary);
}

.thof-milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.thof-milestone-card {
    background: var(--thof-card-bg);
    border: 1px solid var(--thof-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--thof-shadow);
    transition: transform 0.2s ease;
}

.thof-milestone-card:hover {
    transform: translateY(-2px);
}

.thof-milestone-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.thof-milestone-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--thof-text);
}

.thof-milestone-points {
    font-size: 14px;
    color: var(--thof-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.thof-milestone-description {
    font-size: 12px;
    color: var(--thof-text-light);
    line-height: 1.4;
}

.thof-points-info {
    margin-top: 30px;
}

.thof-info-card {
    background: var(--thof-card-bg);
    border: 1px solid var(--thof-border);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--thof-shadow);
}

.thof-info-card h4 {
    margin: 0 0 15px 0;
    color: var(--thof-primary);
}

.thof-info-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.thof-info-list li {
    position: relative;
    margin-bottom: 8px;
    color: var(--thof-text-light);
    line-height: 1.5;
}

.thof-info-list li:before {
    content: "✓";
    position: absolute;
    left: -20px;
    color: var(--thof-secondary);
    font-weight: bold;
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.thof-widget {
    background: var(--thof-card-bg);
    border: 1px solid var(--thof-border);
    border-radius: 8px;
    box-shadow: var(--thof-shadow);
    overflow: hidden;
}

/* Widget Compacto */
.thof-widget-compact {
    padding: 20px;
}

.thof-widget-stats-mini {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.thof-widget-top-compact {
    margin-bottom: 20px;
}

.thof-widget-subtitle {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--thof-primary);
    text-align: center;
}

.thof-widget-user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--thof-border);
}

.thof-widget-user-mini:last-child {
    border-bottom: none;
}

.thof-mini-medal {
    font-size: 16px;
    min-width: 25px;
}

.thof-mini-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.thof-mini-points {
    font-size: 14px;
    font-weight: 600;
    color: var(--thof-primary);
}

.thof-widget-latest-activity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--thof-background);
    border-radius: 6px;
}

.thof-activity-icon-mini {
    font-size: 16px;
}

.thof-activity-user-mini {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.thof-activity-time-mini {
    font-size: 12px;
    color: var(--thof-text-light);
}

/* Widget Completo */
.thof-widget-full {
    padding: 25px;
}

.thof-widget-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.thof-widget-stat {
    text-align: center;
    padding: 15px;
    background: var(--thof-background);
    border-radius: 6px;
}

.thof-widget-stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.thof-widget-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #22c55e;
    display: block;
    margin-bottom: 4px;
}

.thof-widget-stat-label {
    font-size: 11px;
    color: var(--thof-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thof-widget-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.thof-widget-section {
    background: var(--thof-background);
    border-radius: 6px;
    padding: 20px;
}

.thof-widget-section-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #22c55e;
    text-align: center;
}

.thof-widget-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--thof-border);
}

.thof-widget-user:last-child {
    border-bottom: none;
}

.thof-widget-user-position {
    font-size: 18px;
    min-width: 30px;
}

.thof-widget-user-info {
    flex: 1;
}

.thof-widget-user-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.thof-widget-user-points {
    font-size: 12px;
    color: var(--thof-text-light);
}

.thof-widget-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--thof-border);
}

.thof-widget-activity-item:last-child {
    border-bottom: none;
}

.thof-widget-activity-icon {
    font-size: 16px;
    min-width: 20px;
}

.thof-widget-activity-content {
    flex: 1;
}

.thof-widget-activity-user {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.thof-widget-activity-time {
    font-size: 11px;
    color: var(--thof-text-light);
}

.thof-widget-activity-points {
    font-size: 12px;
    font-weight: 600;
    color: var(--thof-secondary);
}

.thof-widget-footer {
    text-align: center;
    padding: 15px 20px;
    border-top: 1px solid var(--thof-border);
    background: var(--thof-background);
}

.thof-widget-link {
    color: #22c55e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.thof-widget-link:hover {
    color: var(--thof-primary-dark);
    text-decoration: none;
}

/* ==========================================================================
   Common Utilities
   ========================================================================== */

.thof-frontend-message {
    text-align: center;
    padding: 40px 20px;
    background: var(--thof-card-bg);
    border: 1px solid var(--thof-border);
    border-radius: 8px;
    color: var(--thof-text-light);
    font-size: 16px;
    box-shadow: var(--thof-shadow);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .thof-title {
        font-size: 20px;
    }
    
    .thof-leaderboard-cards {
        grid-template-columns: 1fr;
    }
    
    .thof-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .thof-search-input-group {
        flex-direction: column;
    }
    
    .thof-search-results-container {
        grid-template-columns: 1fr;
    }
    
    .thof-position-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .thof-position-stats {
        grid-template-columns: 1fr;
    }
    
    .thof-position-actions {
        flex-direction: column;
    }
    
    .thof-points-simple {
        grid-template-columns: 1fr;
    }
    
    .thof-milestones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .thof-widget-content {
        grid-template-columns: 1fr;
    }
    
    .thof-widget-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .thof-table {
        font-size: 12px;
        min-width: 600px; /* Asegurar scroll horizontal */
    }
    
    .thof-table th,
    .thof-table td {
        padding: 6px 4px;
    }
    
    /* Mantener todas las columnas visibles con scroll */
    .thof-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .thof-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .thof-milestones-grid {
        grid-template-columns: 1fr;
    }
    
    .thof-widget-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .thof-action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .thof-search-form,
    .thof-widget-footer,
    .thof-position-actions {
        display: none;
    }
    
    .thof-card,
    .thof-table-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .thof-leaderboard-cards,
    .thof-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Dark Theme Enhancements & Missing Styles
   ========================================================================== */

/* Complete search form styling */
.thof-search-input {
    background: var(--thof-bg-secondary) !important;
    color: var(--thof-text-primary) !important;
    border: 2px solid var(--thof-border) !important;
}

.thof-search-input:focus {
    outline: none !important;
    border-color: var(--thof-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1) !important;
}

.thof-search-button {
    background: var(--thof-gradient-accent) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3) !important;
}

.thof-search-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4) !important;
}

/* Glow effects for medal positions */
.thof-user-card[data-position="1"]:hover {
    box-shadow: var(--thof-shadow-hover), 0 0 30px rgba(255, 215, 0, 0.4) !important;
}

.thof-user-card[data-position="2"]:hover {
    box-shadow: var(--thof-shadow-hover), 0 0 30px rgba(192, 192, 192, 0.4) !important;
}

.thof-user-card[data-position="3"]:hover {
    box-shadow: var(--thof-shadow-hover), 0 0 30px rgba(205, 127, 50, 0.4) !important;
}

/* Loading states */
.thof-loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
    position: relative !important;
}

.thof-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 -10px !important;
    border: 2px solid var(--thof-border) !important;
    border-top-color: var(--thof-primary) !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced scrollbar styling */
.thof-card::-webkit-scrollbar,
.thof-stats::-webkit-scrollbar {
    width: 6px !important;
}

.thof-card::-webkit-scrollbar-track,
.thof-stats::-webkit-scrollbar-track {
    background: var(--thof-bg-tertiary) !important;
    border-radius: 3px !important;
}

.thof-card::-webkit-scrollbar-thumb,
.thof-stats::-webkit-scrollbar-thumb {
    background: var(--thof-border-light) !important;
    border-radius: 3px !important;
}

.thof-card::-webkit-scrollbar-thumb:hover,
.thof-stats::-webkit-scrollbar-thumb:hover {
    background: var(--thof-primary) !important;
}

/* ==========================================================================
   SISTEMA DE RANGOS
   ========================================================================== */

/* Rangos en tabla */
.thof-rank {
    vertical-align: middle;
    padding: 8px 12px;
}

.rank-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.rank-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-image {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.rank-emoji {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.rank-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--thof-text-primary);
    line-height: 1.2;
}

.rank-progress {
    width: 100%;
    margin-top: 2px;
}

.rank-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--thof-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
    position: relative;
}

.rank-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--thof-secondary), var(--thof-primary));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.rank-progress-text {
    font-size: 10px;
    color: var(--thof-text-muted);
    font-weight: 500;
    display: block;
    text-align: right;
}

.no-rank {
    font-size: 12px;
    color: var(--thof-text-muted);
    font-style: italic;
    padding: 8px;
}

/* Rangos en cards */
.thof-rank-card {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
    padding: 8px 12px;
    background: var(--thof-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--thof-border);
}

.thof-rank-card .rank-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.rank-image-card {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.rank-name-card {
    font-size: 13px;
    font-weight: 600;
    color: var(--thof-text-primary);
    line-height: 1.2;
}

.thof-rank-card .rank-progress {
    width: 100%;
    margin-top: 2px;
}

.thof-rank-card .rank-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--thof-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}

.thof-rank-card .rank-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--thof-secondary), var(--thof-primary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.thof-rank-card .rank-progress-text {
    font-size: 10px;
    color: var(--thof-text-muted);
    font-weight: 500;
    text-align: right;
}

/* Rangos en estilo minimal */
.thof-rank-minimal {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--thof-text-secondary);
}

.rank-image-minimal {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

/* Colores de rangos según nivel */
.rank-display[data-rank*="novato"] .rank-name,
.thof-rank-card[data-rank*="novato"] .rank-name-card {
    color: var(--thof-rank-novato);
}

.rank-display[data-rank*="veterano"] .rank-name,
.thof-rank-card[data-rank*="veterano"] .rank-name-card {
    color: var(--thof-rank-veterano);
}

.rank-display[data-rank*="elite"] .rank-name,
.thof-rank-card[data-rank*="elite"] .rank-name-card {
    color: var(--thof-rank-elite);
}

.rank-display[data-rank*="profesional"] .rank-name,
.thof-rank-card[data-rank*="profesional"] .rank-name-card {
    color: var(--thof-rank-profesional);
}

.rank-display[data-rank*="maestro"] .rank-name,
.thof-rank-card[data-rank*="maestro"] .rank-name-card {
    color: var(--thof-rank-maestro);
}

.rank-display[data-rank*="gran_maestro"] .rank-name,
.thof-rank-card[data-rank*="gran_maestro"] .rank-name-card {
    color: var(--thof-rank-gran-maestro);
}

.rank-display[data-rank*="legendario"] .rank-name,
.thof-rank-card[data-rank*="legendario"] .rank-name-card {
    color: var(--thof-rank-legendario);
    text-shadow: 0 0 10px var(--thof-rank-legendario);
    animation: legendary-glow 2s ease-in-out infinite alternate;
}

@keyframes legendary-glow {
    from { text-shadow: 0 0 10px var(--thof-rank-legendario); }
    to { text-shadow: 0 0 20px var(--thof-rank-legendario), 0 0 30px var(--thof-rank-legendario); }
}

/* Responsive para rangos */
@media (max-width: 768px) {
    /* Tabla responsive con scroll horizontal */
    .thof-table-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .thof-table {
        min-width: 700px; /* Aumentar ancho mínimo para tablet */
    }
    
    .thof-table th,
    .thof-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* Ajustar anchos manteniendo proporciones */
    .thof-position {
        width: 8%;
        min-width: 56px;
    }
    
    .thof-username {
        width: 15%;
        min-width: 105px;
    }
    
    .thof-rank {
        width: 25%;
        min-width: 175px;
    }
    
    .thof-points {
        width: 10%;
        min-width: 70px;
    }
    
    .thof-actions {
        width: 10%;
        min-width: 70px;
    }
    
    .thof-last-activity {
        width: 30%;
        min-width: 210px;
    }
    
    /* Rangos más compactos */
    .rank-display {
        gap: 4px;
    }
    
    .rank-header {
        gap: 6px;
    }
    
    .rank-image {
        width: 28px;
        height: 28px;
    }
    
    .rank-name {
        font-size: 11px;
    }
    
    .rank-progress-bar {
        height: 4px;
    }
    
    .rank-progress-text {
        font-size: 9px;
    }
    
    /* Cards en móvil */
    .thof-rank-card {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .rank-image-card {
        width: 28px;
        height: 28px;
    }
    
    .rank-name-card {
        font-size: 12px;
    }
    
    .thof-rank-card .rank-progress-bar {
        height: 4px;
    }
    
    .thof-rank-card .rank-progress-text {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    /* Móviles muy pequeños - mantener scroll horizontal */
    .thof-table {
        min-width: 600px; /* Ancho mínimo para móvil pequeño */
    }
    
    .thof-table th,
    .thof-table td {
        padding: 6px 2px;
        font-size: 11px;
    }
    
    /* Anchos mínimos más pequeños para móvil */
    .thof-position {
        min-width: 48px;
    }
    
    .thof-username {
        min-width: 90px;
    }
    
    .thof-rank {
        min-width: 150px;
    }
    
    .thof-points {
        min-width: 60px;
    }
    
    .thof-actions {
        min-width: 60px;
    }
    
    .thof-last-activity {
        min-width: 180px;
    }
    
    .rank-image {
        width: 24px;
        height: 24px;
    }
    
    .rank-name {
        font-size: 10px;
    }
    
    .rank-progress-text {
        font-size: 8px;
    }
}
