body {
    font-family: 'Open Sans', sans-serif !important;
    color: #002147 !important;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700;
}
.brand-font {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700;    
}
.bg-primary {
    background-color: #002147 !important;
}
.text-primary {
    color: #002147 !important;
}
.bg-accent {
    background-color: #4169E1 !important;
}
.text-accent {
    color: #4169E1 !important;
}
.bg-gold {
    background-color: #D4A017 !important;
}
.text-gold {
    color: #D4A017 !important;
}
.text-grey {
    color: #D4A017 !important;
}
.bg-neutral {
    background-color: #F0F0F0 !important;
}
.upvote-btn, .downvote-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
}
.upvote-count, .downvote-count {
    font-size: 0.8rem;
    margin: 0 5px;
}
.btn, .btn-primary {
    background-color: #002147;
    border-color: #002147;
    --bs-btn-border-color: #002147;
}
.btn-warning {
    color: #F0F0F0;
}
.card-body {
    display: flex;
    flex-direction: column;
}

.card-body .btn {
    margin-top: auto;
}

.tile-card .card-body {
    height: 100%;
}

.tile-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
}

.tile-card .card-body-overlay {
    background-color: rgba(0, 33, 71, 0.8); /* Oxford Blue with 80% opacity */
    height: 100%;
}

.tile-card .card-title,
.tile-card .card-text {
    color: white;
}

.tile-card .btn-primary {
    background-color: #D4A017; /* Prestige Gold */
    border-color: #D4A017;
    color: #002147; /* Oxford Blue */
}

/* Account pages styling */
.account-form .card {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.account-form .card-title {
    color: #002147; /* Oxford Blue */
}

.account-form .btn-primary {
    background-color: #D4A017; /* Prestige Gold */
    border-color: #D4A017;
    color: #002147; /* Oxford Blue */
}

.account-form .form-control:focus {
    border-color: #D4A017;
    box-shadow: 0 0 0 0.25rem rgba(212, 160, 23, 0.25);
}

.account-form a {
    color: #4169E1; /* Signal Blue */
}

.account-form a:hover {
    color: #002147; /* Oxford Blue */
}

/* Social media icons */
.socialaccount_providers {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.socialaccount_providers .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 10px;
    font-size: 1rem;
    border-radius: 5px;
    text-decoration: none;
    color: #002147; /* Oxford Blue */
    background-color: #F0F0F0; /* Cool Grey */
    border: 1px solid #ddd;
    transition: all 0.3s ease-in-out;
}

.socialaccount_providers .btn:hover {
    background-color: #D4A017; /* Prestige Gold */
    color: #002147;
    border-color: #D4A017;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.socialaccount_providers .btn .social-icon {
    width: 24px;
    height: 24px;
}

.social-icon-large {
    width: 64px;
    height: 64px;
}

form.login, form.signup {
    margin-bottom: 1rem;
}

.login-logout-btn {
    border-color: #f0f0f0 !important;
}

/* Custom styling for ranking search box */
.ranking-search-group .btn {
    border-color: var(--bs-border-color);
    background-color: #f0f0f0;
    color: #002147; /* Icon color */
}

.ranking-search-group .btn:hover {
    background-color: rgba(13, 110, 253, 0.25);
    border-color: rgba(13, 110, 253, 0.25); /* Slight hover effect */
}

/* ------------------------------------------- */
/* Modern Ranking Table Styling                */
/* ------------------------------------------- */

/* Container and General Table */
.ranking-table-container {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0.5rem;
    overflow-x: auto; /* Changed from hidden to auto to allow scrolling */
    width: 100%;
    display: block;
    -webkit-overflow-scrolling: touch;
    background: white;
    border: 1px solid #eaeaea;
}

.ranking-table {
    margin-bottom: 0 !important; /* Remove bottom margin to fit container */
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 800px; /* Ensure table has enough width to be readable on mobile */
}

/* Header Styling */
.ranking-table thead th {
    background-color: #002147; /* Oxford Blue */
    color: #D4A017; /* Prestige Gold */
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem; /* Slightly larger for better readability */
    letter-spacing: 0.02em; /* Reduced spacing */
    padding: 1rem;
    border-bottom: 3px solid #D4A017;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: normal; /* Allow wrapping */
    vertical-align: bottom; /* Bottom align wrapped text */
    line-height: 1.2;
}

.ranking-table thead th a {
    color: #D4A017;
    text-decoration: none;
}
.ranking-table thead th a:hover {
    color: #fff;
}

/* Scrollbar Styling for attractive scrolling */
.ranking-table-container::-webkit-scrollbar {
    height: 10px;
}

.ranking-table-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 0 0 0.5rem 0.5rem;
}

.ranking-table-container::-webkit-scrollbar-thumb {
    background-color: #002147;
    border-radius: 5px;
    border: 2px solid #f0f0f0; /* Creates padding effect */
}

.ranking-table-container::-webkit-scrollbar-thumb:hover {
    background-color: #4169E1;
}

/* Row Styling */
.ranking-table tbody tr {
    transition: background-color 0.2s ease-in-out;
}

.ranking-table tbody tr:hover {
    background-color: rgba(65, 105, 225, 0.05) !important; /* Very light signal blue */
}

.ranking-table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

/* Column Specifics */

/* Rank Column */
.ranking-table .rank-cell {
    font-size: 1.25rem;
    font-weight: 800;
    color: #002147;
    text-align: center;
    width: 80px; /* Fixed width for rank */
}

/* Make the rank look like a circle badge if needed, or just large text */
.ranking-table .rank-cell span {
    display: inline-block;
    min-width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: #002147;
    text-align: center;
    border: 2px solid #D4A017;
}

/* Entity/Name Column */
.ranking-table .entity-cell {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #002147;
}

/* Score Column */
.ranking-table .score-cell {
    font-weight: 700;
    color: #4169E1; /* Signal Blue */
    font-size: 1.1rem;
}

/* Metric Columns (generated dynamically) */
.ranking-table td:not(.rank-cell):not(.entity-cell):not(.score-cell) {
    font-size: 0.95rem;
    color: #555;
}