/* ============================================
   Wynncraft Dashboard - Components
   Reusable UI Components
   ============================================ */

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: var(--font-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-in-out);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-accent));
    color: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--gold-primary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-card);
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--gold-accent);
    border: 2px solid var(--gold-primary);
}

.btn-ghost:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: var(--glow-gold);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: all var(--duration-normal) var(--ease-in-out);
}

.card:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: var(--font-xl);
    color: var(--gold-accent);
    margin: 0;
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    margin-top: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

/* Medieval Border Card */
.card-medieval {
    position: relative;
    border: 2px solid var(--gold-primary);
}

.card-medieval::before,
.card-medieval::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gold-accent);
}

.card-medieval::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.card-medieval::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

/* ============================================
   Input Fields
   ============================================ */
.input-group {
    margin-bottom: var(--space-3);
}

.input-label {
    display: block;
    margin-bottom: var(--space-1);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
}

.input {
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: var(--font-base);
    transition: all var(--duration-normal) var(--ease-in-out);
}

.input:focus {
    border-color: var(--gold-primary);
    box-shadow: var(--glow-gold);
    outline: none;
}

.input::placeholder {
    color: var(--text-muted);
}

/* Search Input with Icon */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    padding-left: 48px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-accent);
    font-size: var(--font-lg);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-accent));
    color: var(--bg-primary);
}

.badge-success {
    background: var(--success-green);
    color: white;
}

.badge-danger {
    background: var(--danger-red);
    color: white;
}

.badge-info {
    background: var(--info-blue);
    color: white;
}

.badge-legendary {
    background: var(--legendary-purple);
    color: white;
    box-shadow: var(--glow-purple);
}

.badge-mythic {
    background: var(--mythic-pink);
    color: white;
}

/* ============================================
   Player Card
   ============================================ */
.player-card {
    background: var(--bg-card);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
    transition: all var(--duration-normal) var(--ease-in-out);
}

.player-card:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold);
}

.player-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.player-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    border: 2px solid var(--gold-primary);
    box-shadow: var(--glow-gold);
}

.player-info h3 {
    font-size: var(--font-2xl);
    color: var(--gold-accent);
    margin-bottom: var(--space-1);
}

.player-rank {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

.player-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.player-stat {
    text-align: center;
    padding: var(--space-2);
    background: rgba(212, 175, 55, 0.05);
    border-radius: var(--radius-sm);
}

.player-stat-value {
    font-family: 'Orbitron', monospace;
    font-size: var(--font-xl);
    font-weight: var(--font-bold);
    color: var(--gold-accent);
    display: block;
}

.player-stat-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ============================================
   Leaderboard
   ============================================ */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-card);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    transition: all var(--duration-normal) var(--ease-in-out);
}

.leaderboard-item:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--glow-gold);
    transform: translateX(4px);
}

.leaderboard-rank {
    font-family: 'Orbitron', monospace;
    font-size: var(--font-2xl);
    font-weight: var(--font-bold);
    color: var(--gold-accent);
    min-width: 50px;
    text-align: center;
}

.leaderboard-rank.top-1 {
    color: var(--gold-primary);
    text-shadow: var(--glow-gold);
}

.leaderboard-rank.top-2 {
    color: #c0c0c0;
}

.leaderboard-rank.top-3 {
    color: #cd7f32;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-size: var(--font-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.leaderboard-score {
    font-family: 'Orbitron', monospace;
    font-size: var(--font-xl);
    font-weight: var(--font-bold);
    color: var(--gold-accent);
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-secondary) 25%,
            rgba(212, 175, 55, 0.1) 50%,
            var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-1);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-2);
}

.skeleton-card {
    height: 200px;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: var(--space-2);
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    margin-bottom: var(--space-4);
}

.tab {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-base);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-in-out);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--gold-accent);
}

.tab.active {
    color: var(--gold-accent);
    border-bottom-color: var(--gold-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid rgba(212, 175, 55, 0.2);
    padding: var(--space-6) 0;
    margin-top: var(--space-12);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-text {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

.footer-links {
    display: flex;
    gap: var(--space-3);
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    font-size: var(--font-sm);
    transition: color var(--duration-normal) var(--ease-in-out);
}

.footer-links a:hover {
    color: var(--gold-accent);
}