/* Dashboard specific styles */

/* Disable text selection on dashboard elements */
.section-title,
.stat-card,
.stat-value,
.stat-label,
.hobbit-stat-item,
.hobbit-name,
.hobbit-count,
.country-card,
.country-name,
.country-total,
.country-hobbit-item,
.hobbit-country-item,
.nav-link,
.filter-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dashboard-nav {
    margin-bottom: 30px;
    text-align: center;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(139, 69, 19, 0.3);
    color: rgba(255, 223, 0, 0.9);
    text-decoration: none;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 69, 19, 0.5);
    transition: all 0.3s ease;
    margin: 0 5px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:focus {
    outline: none;
}

.nav-link:active {
    outline: none;
}

.nav-link:hover {
    background: rgba(139, 69, 19, 0.5);
    border-color: #8b4513;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Loading screen */
.loading-card {
    background: rgba(60, 40, 20, 0.85);
    backdrop-filter: blur(10px);
    padding: 60px 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(139, 69, 19, 0.2);
    border: 2px solid rgba(139, 69, 19, 0.5);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 69, 19, 0.3);
    border-top-color: #8b4513;
    border-right-color: #6b8e23;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.5);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-card p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Error screen */
.error-card {
    background: rgba(60, 40, 20, 0.85);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(220, 20, 60, 0.5), inset 0 0 30px rgba(255, 100, 100, 0.1);
    border: 2px solid rgba(255, 100, 100, 0.5);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(220, 20, 60, 0.6));
}

.error-card h2 {
    font-family: 'Cinzel', serif;
    color: #ff6b6b;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.error-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
}

/* Stats sections */
.stats-section {
    background: rgba(60, 40, 20, 0.85);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(139, 69, 19, 0.2);
    border: 2px solid rgba(139, 69, 19, 0.5);
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #ffdf00;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b4513, #6b8e23, #ffdf00, transparent);
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.6);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.stat-card {
    background: rgba(80, 50, 25, 0.6);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(139, 69, 19, 0.4);
    transition: all 0.3s ease;
    box-shadow: inset 0 0 20px rgba(139, 69, 19, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.5), 0 0 30px rgba(255, 215, 0, 0.3);
    border-color: #8b4513;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #ffdf00;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hobbit stats */
.hobbit-stats-container {
    display: grid;
    gap: 15px;
}

.hobbit-stat-item {
    background: rgba(80, 50, 25, 0.5);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(139, 69, 19, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.hobbit-stat-item:hover {
    border-color: #8b4513;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
}

.hobbit-avatar-small {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #8b4513;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6b8e23, #8b4513);
    box-shadow: 0 0 15px rgba(139, 69, 19, 0.6);
    overflow: hidden;
}

.hobbit-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hobbit-info {
    flex: 1;
}

.hobbit-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #ffdf00;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.hobbit-stats-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar-horizontal {
    flex: 1;
    height: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.progress-fill-horizontal {
    height: 100%;
    background: linear-gradient(90deg, #8b4513, #6b8e23, #ffdf00);
    background-size: 200% 100%;
    border-radius: 12px;
    transition: width 0.8s ease;
    animation: progressShimmer 2s linear infinite;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
    position: absolute;
    top: 0;
    left: 0;
}

@keyframes progressShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 2;
    pointer-events: none;
}

.hobbit-count {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 80px;
    text-align: right;
}

/* Filter container */
.filter-container {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-container label {
    font-weight: 600;
    color: #ffdf00;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.country-select,
.hobbit-select {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid rgba(139, 69, 19, 0.4);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(80, 50, 25, 0.6);
    backdrop-filter: blur(5px);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
}

.country-select:focus,
.hobbit-select:focus {
    outline: none;
    border-color: #8b4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2), 0 0 15px rgba(139, 69, 19, 0.3);
}

/* Country stats */
.country-stats-container {
    display: grid;
    gap: 20px;
}

.country-card {
    background: rgba(80, 50, 25, 0.6);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(139, 69, 19, 0.4);
    box-shadow: inset 0 0 20px rgba(139, 69, 19, 0.1);
}

.country-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.5);
}

.country-name {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: #ffdf00;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.country-total {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.country-hobbits {
    display: grid;
    gap: 10px;
}

.country-hobbit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(60, 40, 20, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(139, 69, 19, 0.3);
}

.country-hobbit-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.country-hobbit-count {
    color: rgba(255, 223, 0, 0.9);
    font-weight: 600;
}

/* Hobbit country stats */
.hobbit-country-container {
    display: grid;
    gap: 12px;
}

.hobbit-country-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(80, 50, 25, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    border: 2px solid rgba(139, 69, 19, 0.4);
    transition: all 0.3s ease;
}

.hobbit-country-item:hover {
    border-color: #8b4513;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

.hobbit-country-name {
    flex: 1;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.hobbit-country-count {
    font-weight: 600;
    color: rgba(255, 223, 0, 0.9);
    margin-left: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(139, 69, 19, 0.3));
}

.empty-state p {
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hobbit-stat-item {
        flex-direction: column;
        text-align: center;
    }
    
    .hobbit-info {
        width: 100%;
    }
    
    .hobbit-stats-bar {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-bar-horizontal {
        flex: none;
        width: 100%;
        height: 30px;
    }
    
    .progress-percentage {
        font-size: 0.9rem;
    }
    
    .hobbit-count {
        text-align: center;
        width: 100%;
        min-width: auto;
        font-size: 1rem;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .country-select,
    .hobbit-select {
        width: 100%;
    }
    
    .country-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .dashboard-nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-link {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .stats-section {
        padding: 20px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}
