/* Theme Manager Styles */

.theme-selector-menu {
    min-width: 180px;
}

.theme-selector-menu .dropdown-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #e9ecef;
}

.theme-selector-menu .theme-option {
    position: relative;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-selector-menu .theme-option:hover {
    background-color: #f8f9fa;
    color: inherit;
    text-decoration: none;
}

.theme-selector-menu .theme-option i:first-child {
    color: #6c757d;
}

.theme-selector-menu .theme-check {
    opacity: 0;
    color: var(--bs-primary);
    font-size: 1.1em;
}

.theme-selector-menu .theme-option.active .theme-check {
    opacity: 1;
}

/* Dark theme adjustments */
[data-theme="dark"] .theme-selector-menu .dropdown-header {
    color: #e9ecef;
    border-bottom-color: #495057;
}

[data-theme="dark"] .theme-selector-menu .theme-option:hover {
    background-color: #343a40;
}

[data-theme="dark"] .theme-selector-menu .theme-option i:first-child {
    color: #adb5bd;
}

/* Theme transition effects - Smooth transitions */
#bootstrap-style,
#app-style {
    transition: none; /* Keep instant for CSS switching */
}

/* Smooth transitions for theme elements */
.theme-selector-menu .theme-option,
.theme-selector-menu .theme-option-icon,
#theme-selector-btn,
.auth-controls-bar .btn-outline-light {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global smooth transitions for theme changes */
* {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent layout shifts during theme transitions */
html, body {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Smooth image transitions */
img {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Card transitions */
.card, .card-body, .form-control, .btn {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Loading state during theme transition */
.theme-transitioning {
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.theme-transitioning::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.02);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: themeTransitionFade 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .theme-transitioning::before {
    background: rgba(0, 0, 0, 0.05);
}

@keyframes themeTransitionFade {
    0% { opacity: 0; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

.theme-transitioning * {
    transition-duration: 0.4s !important;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Prevent flash during theme transitions */
.theme-transitioning img {
    filter: blur(0.5px);
    transform: scale(0.995);
}

/* Logo management with CSS background-image */
.auth-logo-container {
    width: 70%;
    max-width: 300px;
    height: 80px;
    margin: 0 auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Logo for light theme */
[data-theme="light"] .auth-logo-container,
[data-theme="system"] .auth-logo-container {
    background-image: url('/assets/images/SportyGo.png');
}

/* Logo for dark theme */
[data-theme="dark"] .auth-logo-container {
    background-image: url('/assets/images/SportyGo-Dark.png');
}

/* Button transitions */
.btn {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Form control transitions */
.form-control, .form-select {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Active theme indicator */
.theme-selector-menu .theme-option.active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

[data-theme="dark"] .theme-selector-menu .theme-option.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Auth Controls Bar */
.auth-controls-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    background: transparent;
    transition: all 0.3s ease;
}

.auth-controls-bar .btn-outline-light {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: none;
}

.auth-controls-bar .btn-outline-light:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
    transform: scale(1.05);
}

[data-theme="dark"] .auth-controls-bar .btn-outline-light {
    color: #adb5bd;
}

[data-theme="dark"] .auth-controls-bar .btn-outline-light:hover {
    background-color: rgba(173, 181, 189, 0.1);
    color: #f8f9fa;
}

/* Theme Options Grid */
.theme-options-grid {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    justify-content: center;
}

.theme-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
    font-size: 1.1rem;
}

.theme-option-icon:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
    transform: scale(1.1);
    border-color: rgba(108, 117, 125, 0.3);
}

.theme-option-icon.active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

[data-theme="dark"] .theme-option-icon {
    color: #adb5bd;
}

[data-theme="dark"] .theme-option-icon:hover {
    background-color: rgba(173, 181, 189, 0.1);
    color: #f8f9fa;
    border-color: rgba(173, 181, 189, 0.3);
}

[data-theme="dark"] .theme-option-icon.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* Auth Controls Bar - Minimal Icons Only */
.auth-controls-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    background: transparent;
    transition: all 0.3s ease;
}

.auth-controls-bar .btn-outline-light {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: none;
}

.auth-controls-bar .btn-outline-light:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
    transform: scale(1.05);
}

[data-theme="dark"] .auth-controls-bar .btn-outline-light {
    color: #adb5bd;
}

[data-theme="dark"] .auth-controls-bar .btn-outline-light:hover {
    background-color: rgba(173, 181, 189, 0.1);
    color: #f8f9fa;
}

.auth-controls-bar .dropdown-menu {
    margin-top: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

.auth-controls-bar .dropdown-item {
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-controls-bar .dropdown-item:hover {
    background-color: rgba(108, 117, 125, 0.1);
    transform: translateX(2px);
}

[data-theme="dark"] .auth-controls-bar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Override Bootstrap color variables for light theme */
[data-theme="light"] {
    --bs-blue: #262b3c;
    --bs-primary: #262b3c;
}

/* Override specific color usages for light theme */
[data-theme="light"] .wizard .steps .number {
    border-color: #262b3c;
    color: #262b3c;
}

[data-theme="light"] .wizard .steps .current a .number,
[data-theme="light"] .wizard .steps .current a:active .number,
[data-theme="light"] .wizard .steps .current a:hover .number {
    background-color: #262b3c;
}

/* Override theme selector colors */
[data-theme="light"] .theme-selector-menu .theme-check {
    color: #262b3c;
}

[data-theme="light"] .theme-selector-menu .theme-option.active {
    background-color: rgba(38, 43, 60, 0.1);
    color: #262b3c;
}

[data-theme="light"] .theme-option-icon.active {
    background-color: rgba(38, 43, 60, 0.1);
    color: #262b3c;
    border-color: #262b3c;
}

/* Mobile responsiveness for auth controls */
@media (max-width: 576px) {
    .auth-controls-bar {
        top: 15px;
        right: 15px;
    }

    .auth-controls-bar .btn {
        width: 35px;
        height: 35px;
    }

    .auth-controls-bar .btn img {
        height: 16px !important;
    }
}