/**
 * 🏛️ PROFILE TABS SYSTEM - MODERN STYLING
 * 
 * Comprehensive styling for the modular tab system that supports
 * animations, responsive design, and easy theming for future enhancements
 */

/* =============================================================================
   �️ PROFILE TABS GRID LAYOUT
   ============================================================================= */

.profile-tabs {
    margin-bottom: 2rem;
}

.tab-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(26, 31, 46, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.profile-tab {
    background: linear-gradient(135deg, rgba(42, 48, 64, 0.9) 0%, rgba(26, 31, 46, 0.8) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-tab .tab-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    transition: transform 0.3s ease;
}

.profile-tab .tab-text {
    font-size: 0.8rem;
    line-height: 1.2;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.profile-tab:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15);
    color: rgba(255, 255, 255, 1);
}

.profile-tab:hover .tab-icon {
    transform: scale(1.1);
}

.profile-tab:hover .tab-text {
    opacity: 1;
}

.profile-tab.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: var(--gold-primary, #ffd700);
    color: var(--gold-primary, #ffd700);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.profile-tab.active .tab-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.profile-tab.active .tab-text {
    opacity: 1;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-navigation {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .profile-tab {
        min-height: 70px;
        padding: 0.75rem 0.25rem;
    }
    
    .profile-tab .tab-icon {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .profile-tab .tab-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .tab-navigation {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.5rem;
    }
    
    .profile-tab {
        min-height: 60px;
        padding: 0.5rem 0.25rem;
    }
    
    .profile-tab .tab-icon {
        font-size: 1.1rem;
    }
    
    .profile-tab .tab-text {
        font-size: 0.7rem;
    }
}

/* =============================================================================
   �🎨 TAB LOADING STATES
   ============================================================================= */

.tab-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted, #888);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 215, 0, 0.1);
    border-left: 3px solid var(--gold-primary, #ffd700);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.tab-loading-state p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/* =============================================================================
   ⚠️ TAB ERROR STATES
   ============================================================================= */

.tab-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted, #888);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.tab-error-state p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.error-message {
    font-size: 0.9rem !important;
    color: var(--error-color, #ff6b6b) !important;
    font-style: italic;
    margin-bottom: 1.5rem !important;
}

.retry-btn {
    background: linear-gradient(135deg, var(--gold-primary, #ffd700) 0%, var(--gold-secondary, #ffed4e) 100%);
    color: var(--dark-bg, #1a1f2e);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* =============================================================================
   🏆 WISDOM RANK STYLING ENHANCEMENTS
   ============================================================================= */

.wisdom-rank-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.rank-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(42, 48, 64, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rank-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.1);
}

.rank-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold-primary, #ffd700) 0%, var(--gold-secondary, #ffed4e) 100%);
    color: var(--dark-bg, #1a1f2e);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 1rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.rank-number.top-3 {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.rank-number.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1f2e;
    box-shadow: 0 3px 12px rgba(255, 215, 0, 0.5);
    animation: goldGlow 2s ease-in-out infinite alternate;
}

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

.rank-number.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a055 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(205, 127, 50, 0.4);
}

@keyframes goldGlow {
    0% { box-shadow: 0 3px 12px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 3px 20px rgba(255, 215, 0, 0.8); }
}

.rank-content {
    flex: 1;
    min-width: 0;
}

.rank-quote {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary, #e0e6ed);
    margin-bottom: 0.75rem;
    font-style: italic;
    position: relative;
}

.rank-quote::before {
    content: '"';
    font-size: 1.5rem;
    color: var(--gold-primary, #ffd700);
    position: absolute;
    left: -0.5rem;
    top: -0.2rem;
    opacity: 0.6;
}

.rank-quote::after {
    content: '"';
    font-size: 1.5rem;
    color: var(--gold-primary, #ffd700);
    opacity: 0.6;
}

.rank-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rank-author {
    font-weight: 600;
    color: var(--gold-primary, #ffd700);
    font-size: 0.9rem;
}

.rank-path {
    font-size: 0.85rem;
    color: var(--text-muted, #a0a6b1);
    background: rgba(255, 215, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.rank-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.rank-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted, #a0a6b1);
}

.rank-stat-icon {
    font-size: 1rem;
}

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

@media (max-width: 768px) {
    .rank-item {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .rank-number {
        margin: 0 0 0.75rem 0;
        align-self: center;
    }
    
    .rank-meta {
        justify-content: center;
        text-align: center;
    }
    
    .rank-stats {
        justify-content: center;
    }
}

/* =============================================================================
   🎨 TAB CONTENT ANIMATIONS
   ============================================================================= */

.profile-tab-content {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   🎯 ACCESSIBILITY ENHANCEMENTS
   ============================================================================= */

.profile-tab:focus {
    outline: 2px solid var(--gold-primary, #ffd700);
    outline-offset: 2px;
}

.rank-item:focus-within {
    border-color: var(--gold-primary, #ffd700);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* =============================================================================
   🌙 DARK MODE OPTIMIZATIONS
   ============================================================================= */

@media (prefers-color-scheme: dark) {
    .tab-loading-state,
    .tab-error-state {
        background: rgba(26, 31, 46, 0.8);
    }
    
    .rank-item {
        background: linear-gradient(135deg, rgba(26, 31, 46, 0.98) 0%, rgba(42, 48, 64, 0.95) 100%);
        border-color: rgba(255, 215, 0, 0.15);
    }
}

/* =============================================================================
   🎨 CUSTOM SCROLLBAR FOR WISDOM RANK LIST
   ============================================================================= */

.wisdom-rank-list::-webkit-scrollbar {
    width: 6px;
}

.wisdom-rank-list::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.05);
    border-radius: 3px;
}

.wisdom-rank-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--gold-primary, #ffd700), var(--gold-secondary, #ffed4e));
    border-radius: 3px;
}

.wisdom-rank-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--gold-secondary, #ffed4e), var(--gold-primary, #ffd700));
}
