/* Avatar styles with different sizes */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

/* Standard avatar (medium size for lists/tables) */
.avatar {
    width: 48px;
    height: 48px;
}

/* Large avatar for profile pages */
.avatar-lg {
    width: 150px;
    height: 150px;
    border-width: 3px;
}

/* Small avatar for compact UI elements */
.avatar-sm {
    width: 36px;
    height: 36px;
    border-width: 1px;
}

/* Extra small avatar for dense tables */
.avatar-xs {
    width: 24px;
    height: 24px;
    border-width: 1px;
}

/* Navbar avatar - specific styling for the top navigation */
.navbar-avatar {
    width: 32px;
    height: 32px;
}

/* Avatar container for flexible layouts */
.avatar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hover effects for interactive avatars */
a:hover .avatar, button:hover .avatar {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
    transition: box-shadow 0.15s ease-in-out;
}

/* Base card styles */
.card {
    transition: none;
    width: 100%;
    height: 100%;
    overflow-y: visible;
    box-shadow: none;
}

/* Clickable card styles */
.clickable-card {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Non-clickable card styles */
.non-clickable-card {
    border: 1px solid #dee2e6;
    box-shadow: none !important;
    transition: none !important;
}

.non-clickable-card:hover {
    transform: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

/* Override any conflicting styles */
.card[data-clickable="false"],
.card[data-clickable="false"]:hover {
    transform: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

.card .card-img-top {
    width: 100%;
    height: 50px;
    object-fit: contain;
}

.dropdown-item img {
    width: 30px; /* Thumbnail width */
    height: 30px; /* Thumbnail height */
    margin-right: 10px; /* Space between image and text */
}

/* Avatar selection styles */
.avatar-img-select {
    width: 24px; /* Adjusted thumbnail width */
    height: 24px; /* Adjusted thumbnail height */
    object-fit: cover;
    margin-right: 8px; /* Space between image and text */
}

.select2-container .select2-selection--single {
    height: auto;
    min-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 12px;
    padding-right: 30px;
}

.select2-results__option {
    padding: 8px 12px;
}

/* Select2 custom styles */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--table-stripe);
    color: var(--accent-color);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-results__option {
    color: var(--accent-color);
    background-color: var(--secondary-color);
}

.select2-container--default .select2-selection--single {
    border-color: var(--accent-color);
}

.select2-dropdown {
    border-color: var(--accent-color);
    border-width: 1px;
    border-style: solid;
    border-radius: 0 0 4px 4px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: var(--accent-color);
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary-color);
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 200px;
    overflow-y: auto;
}

.select2-container--default .select2-selection--single {
    border-width: 1px;
    border-style: solid;
}

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    color: var(--accent-color);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-dropdown {
    border: 1px solid var(--accent-color);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.select2-results__option {
    padding: 6px;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--table-stripe);
}

.select2-results__option {
    color: var(--accent-color);
    background-color: var(--secondary-color);
}

.select2-search__field {
    color: var(--accent-color);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--accent-color);
    opacity: 0.7;
}

/* Card styles for races */
.clickable-card {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.non-clickable-card {
    border: 1px solid #dee2e6;
    box-shadow: none !important;
    transition: none !important;
}

.non-clickable-card:hover {
    transform: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

/* Add this to your existing styles */
.card-body {
    display: flex;
    flex-direction: column;
}

.card-body > div:last-child {
    margin-top: auto;
}

.btn-primary {
    align-self: flex-start;
}

/* Drivers page layout */
#drivers-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.driver-card {
    width: calc(50% - 10px);
    margin-bottom: 20px;
}

.offset-card {
    margin-top: calc(50% + 10px);
}

@media (max-width: 767px) {
    .driver-card {
        width: 100%;
    }

    .offset-card {
        margin-top: 0;
    }
}

#drivers-container .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Add these new styles and modify existing ones as needed */

.card-img-wrapper {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.points-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 15px; /* Increased padding */
    border-radius: 20px; /* Increased border-radius */
    font-weight: bold;
    font-size: 1.2em; /* Increased font size */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card-footer {
    background-color: transparent;
    border-top: none;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
}

.card-footer .btn {
    flex: 1;
    margin: 0 5px;
}

#drivers-container .card {
    display: flex;
    flex-direction: column;
}

#drivers-container .card-body {
    flex: 1 0 auto;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .card-img-wrapper {
        height: 250px;
    }
}

/* Add these styles at the end of the file */

.driver-details-card {
    border: 2px solid var(--primary-color);
    background-color: var(--secondary-color);
    color: var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.driver-details-image-container {
    width: 100%;
    padding-top: 100%; /* This creates a 1:1 aspect ratio */
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

.driver-details-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.driver-details-info {
    padding: 1rem;
}

/* Update these existing styles */
.select2-container .select2-selection--single {
    height: auto;
    min-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 12px;
    padding-right: 30px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Add these new styles */
.select2-container--open .select2-dropdown {
    border-color: var(--primary-color);
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 200px;
    overflow-y: auto;
}

.select2-results__option {
    padding: 8px 12px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--primary-color);
}

.select2-container--default .select2-selection--single {
    border: 1px solid var(--primary-color);
}

/* Ensure the dropdown is not cut off */
.select2-container--default .select2-results > .select2-results__options {
    overflow-y: auto;
    max-height: none;
}

/* Adjust the z-index to ensure the dropdown appears above other elements */
.select2-container--open {
    z-index: 9999;
}

/* Theme-specific Select2 styles */
.ferrari-theme .select2-container--default .select2-results__option--highlighted[aria-selected],
.williams-theme .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.mercedes-theme .select2-container--default .select2-results__option--highlighted[aria-selected],
.mclaren-theme .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Ensure text is visible in the dropdown for all themes */
.select2-results__option {
    color: var(--accent-color);
    background-color: var(--secondary-color);
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--table-stripe);
    color: var(--accent-color);
}

/* Adjust the search field color */
.select2-search__field {
    color: var(--accent-color);
}

/* Ensure the placeholder text is visible */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--accent-color);
    opacity: 0.7;
}

/* ... existing styles ... */

.draft-alert {
    background-color: #ffc107;
    color: #000;
    text-align: center;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-size: 1.1em;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.draft-alert p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.draft-alert .emoji {
    font-size: 2.5em; /* Makes the emoji 500% larger */
    line-height: 1;
}

.draft-alert .draft-badge {
    display: inline-block;
    background-color: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draft-alert .draft-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
