/* ========================================
   DENTAL GAMES LAB - RANKING STYLES
   ======================================== */

/* CSS Variables */
:root {
    --navy-dark: #001529;
    --navy-medium: #002140;
    --cyan-primary: #00b4d8;
    --cyan-light: #0096c7;
    --cyan-bright: #48cae4;
    --success-green: #52c41a;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy-medium) 50%, var(--cyan-light) 100%) !important;
    background-attachment: fixed;
    color: white !important;
    min-height: 100vh;
}

/* Headers with gradient text */
h1, h2, h3, h4, .display-4 {
    color: white !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lead {
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#rankingTitle {
    background: linear-gradient(135deg, #48cae4 0%, #00b4d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-align: center;
}

/* Glassmorphism containers */
.glass-card {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.25) 0%, rgba(72, 202, 228, 0.2) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(96, 165, 250, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* User card */
.user-card {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.35) 0%, rgba(72, 202, 228, 0.25) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(96, 165, 250, 0.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 180, 216, 0.2);
}

.user-card h3, .user-card #userNickname {
    color: #48cae4 !important;
    font-weight: 700;
}

.user-card p, .user-card .small {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* No User Card */
#noUserCard {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.25) 0%, rgba(72, 202, 228, 0.2) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(96, 165, 250, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#noUserCard h3 {
    color: #48cae4 !important;
    font-weight: 700;
}

#noUserCard p {
    color: rgba(255, 255, 255, 0.85) !important;
}

#noUserCard .fs-1 {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Tab buttons */
.tab-button {
    width: 200px;
    background: rgba(0, 21, 41, 0.4);
    border: 2px solid rgba(96, 165, 250, 0.3);
    color: white;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--cyan-primary) 0%, var(--cyan-light) 100%);
    border-color: var(--cyan-bright);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.5), 0 0 20px rgba(72, 202, 228, 0.3);
    color: white !important;
    transform: scale(1.05);
}

.tab-button:hover:not(.active) {
    background: rgba(0, 180, 216, 0.2);
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tab-icon {
    width: 80px;
    height: 40px;
    object-fit: contain;
}

/* Ranking table */
.ranking-table {
    background: linear-gradient(135deg, rgba(0, 21, 41, 0.5) 0%, rgba(0, 33, 64, 0.5) 100%) !important;
    border-radius: 12px;
    overflow: hidden;
    color: white !important;
}

.ranking-table thead {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.4) 0%, rgba(72, 202, 228, 0.3) 100%);
    backdrop-filter: blur(10px);
}

.ranking-table thead th {
    border-bottom: 2px solid rgba(231, 236, 242, 0.663) !important;
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem !important;
    text-align: center !important;
    /* text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); */
}

.ranking-table tbody tr {
    border-bottom: 1px solid rgba(96, 165, 250, 0.15) !important;
    transition: all 0.2s ease;
    background: rgba(0, 21, 41, 0.3);
}

.ranking-table tbody tr:hover {
    background-color: rgba(0, 180, 216, 0.2) !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.3);
}

.ranking-table tbody tr.current-user {
    background: linear-gradient(90deg, rgba(0, 180, 216, 0.3) 0%, rgba(72, 202, 228, 0.3) 100%) !important;
    border-left: 4px solid var(--cyan-bright);
}

.ranking-table tbody td {
    color: white !important;
    padding: 1rem !important;
    font-weight: 500;
}

.table>:not(caption)>*>*
{
    background: #11445e;
}
/* Position Badge */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, rgba(72, 202, 228, 0.3) 0%, rgba(6, 182, 212, 0.3) 100%);
    border: 2px solid rgba(72, 202, 228, 0.6);
    color: #48cae4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Medals - Override position-badge styles */
.position-badge.medal {
    font-size: 2rem;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    min-width: auto;
    height: auto;
}

/* Player Info */
.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.player-name {
    font-weight: 700;
    color: #fbbf24 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    font-size: 1rem;
}

/* Top Players */
.top-player {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2) 0%, rgba(251, 191, 36, 0.15) 100%) !important;
    font-weight: 600;
    border-left: 4px solid var(--gold) !important;
}

/* Cell Styles */
.position-cell,
.score-cell,
.level-cell,
.games-cell {
    text-align: center;
    vertical-align: middle;
}

.score-cell {
    font-weight: 700;
    font-size: 1.1rem;
    color: #48cae4 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.level-cell {
    font-weight: 700;
    color: #fbbf24 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.games-cell {
    color: #0ea5e9 !important;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn-create-profile {
    background: linear-gradient(135deg, #48cae4 0%, #00b4d8 100%);
    color: white;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
    transition: all 0.3s ease;
}

.btn-create-profile:hover {
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.6);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white !important;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Legacy modal styles removed - using Bootstrap 5 modals only */

/* Legacy form styles removed - using Bootstrap 5 with .dental-input classes */

/* Loading and Empty States */
#loadingState, #emptyState {
    color: rgba(255, 255, 255, 0.9) !important;
}

#loadingState .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    color: var(--cyan-bright) !important;
}

#emptyState .fs-1 {
    font-size: 3rem !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--navy-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-bright);
}

::selection {
    background: var(--cyan-primary);
    color: white;
}

/* ==================== NAVBAR STYLES ==================== */

.navbar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: color 0.3s ease;
    font-weight: 500;
}

.navbar-nav .nav-link:hover {
    color: var(--cyan-bright) !important;
}

.navbar-nav .nav-link.active {
    color: var(--cyan-bright) !important;
}

.dropdown-menu {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: rgba(96, 165, 250, 0.1) !important;
}

/* ==================== BOOTSTRAP 5 MODAL OVERRIDES ==================== */

/* Modal backdrop - oscuro con blur */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.75);
}

.modal-backdrop.show {
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Modal container */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
}

.modal.show {
    display: flex !important;
    align-items: center;
}

/* Modal XL - Ancho mayor */
.modal-xl {
    max-width: 900px !important;
}

@media (max-width: 991.98px) {
    .modal-xl {
        max-width: 95% !important;
    }
}

/* Dental Modal Theme */
.dental-modal {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%) !important;
    border: 2px solid rgba(96, 165, 250, 0.3) !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(96, 165, 250, 0.1) !important;
    border-radius: 1.5rem !important;
}

/* Modal header */
.dental-modal .modal-header {
    padding: 2rem 2rem 1rem !important;
    border-bottom: none !important;
}

/* Modal body */
.dental-modal .modal-body {
    padding: 0 2rem 2rem !important;
    color: rgba(255, 255, 255, 0.9);
}

/* Modal title with gradient */
.dental-modal-title {
    background: linear-gradient(135deg, #60a5fa 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
}

/* Close button */
.dental-modal .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.7;
    filter: brightness(0) invert(1);
    z-index: 10;
}

.dental-modal .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

/* Dental Tabs */
.dental-tabs {
    border-bottom: 2px solid rgba(96, 165, 250, 0.15) !important;
    padding-bottom: 0 !important;
    margin-bottom: 1.5rem !important;
}

.dental-tabs .nav-link {
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 600 !important;
    padding: 1rem 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dental-tabs .nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(96, 165, 250, 0.05) !important;
}

.dental-tabs .nav-link.active {
    color: #60a5fa !important;
    background: transparent !important;
    border-bottom-color: #60a5fa !important;
}

/* Dental Input Fields */
.dental-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 2px solid rgba(96, 165, 250, 0.3) !important;
    border-radius: 0.75rem !important;
    color: white !important;
    padding: 0.875rem 1rem !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    backdrop-filter: blur(10px);
}

.dental-input:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 0.25rem rgba(96, 165, 250, 0.3) !important;
    color: white !important;
    outline: none !important;
}

.dental-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Dental Buttons */
.dental-btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 0.75rem !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4) !important;
    cursor: pointer;
}

.dental-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6) !important;
    background: linear-gradient(135deg, #0891b2 0%, #0ea5e9 100%) !important;
}

.dental-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4) !important;
}

.dental-btn-outline {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 0.75rem !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
}

.dental-btn-outline:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    transform: translateY(-1px);
}

.dental-btn-outline:active {
    transform: translateY(0);
}

/* Alert Styles */
.dental-modal .alert {
    border-radius: 0.75rem;
    border: none;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dental-modal .alert-success {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border-left: 4px solid #4ade80;
}

.dental-modal .alert-danger {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border-left: 4px solid #f87171;
}

/* ==================== RESPONSIVE NAVBAR ==================== */

@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(15, 23, 42, 0.98);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 0.5rem;
        border: 1px solid rgba(96, 165, 250, 0.2);
    }
    
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }
}

/* ==================== RESPONSIVE TABLE ==================== */

@media (max-width: 768px) {
    .ranking-table {
        font-size: 0.9rem;
    }
    
    .ranking-table thead th {
        padding: 0.75rem !important;
        font-size: 0.75rem;
    }
    
    .ranking-table tbody td {
        padding: 0.75rem !important;
    }
    
    .position-badge.medal {
        font-size: 1.5rem;
    }
    
    .player-icon {
        font-size: 1.2rem;
    }
    
    .position-badge:not(.medal) {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .ranking-table {
        font-size: 0.85rem;
    }
    
    .ranking-table thead th {
        padding: 0.5rem !important;
        font-size: 0.7rem;
    }
    
    .ranking-table tbody td {
        padding: 0.5rem !important;
    }
    
    .score-cell {
        font-size: 1rem;
    }
    
    .tab-icon {
        width: 30px;
        height: 30px;
    }
}
