/* Password Toggle Fix for Production Deployment */

/* Ensure password toggle container is properly positioned */
.password-toggle-container {
    position: relative !important;
    width: 100% !important;
    display: block !important;
}

/* Force proper input styling */
.password-toggle-container .form-control {
    padding-right: 45px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Force toggle button visibility and positioning */
.password-toggle-btn {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 100% !important;
    z-index: 10 !important;
    color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure icon is visible */
.password-toggle-btn i {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Focus and hover states */
.password-toggle-btn:focus {
    outline: none !important;
    color: var(--primary-color, #007bff) !important;
}

.password-toggle-btn:hover {
    color: var(--primary-color, #007bff) !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-radius: 4px !important;
}

/* Ensure Bootstrap icons are loaded and visible */
.bi::before {
    display: inline-block !important;
    font-family: "bootstrap-icons" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Specific icon content to ensure they display even if font fails to load */
.bi-eye::before {
    content: "\f341" !important;
}

.bi-eye-slash::before {
    content: "\f342" !important;
}

/* Fallback for when Bootstrap Icons fail to load */
.password-toggle-btn .bi-eye::before {
    content: "👁" !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

.password-toggle-btn .bi-eye-slash::before {
    content: "🙈" !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

/* Force visibility in admin layout */
.admin-layout .password-toggle-btn,
.admin-content .password-toggle-btn {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1000 !important;
}

/* Input group compatibility */
.input-group .password-toggle-container {
    position: relative !important;
    flex: 1 1 auto !important;
}

.input-group .password-toggle-btn {
    right: 10px !important;
}

/* Form group compatibility */
.form-group .password-toggle-container,
.mb-3 .password-toggle-container {
    position: relative !important;
    width: 100% !important;
}

/* Modal compatibility */
.modal .password-toggle-btn {
    z-index: 2000 !important;
}

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
    .password-toggle-btn {
        color: #adb5bd !important;
    }
    
    .password-toggle-btn:hover,
    .password-toggle-btn:focus {
        color: #fff !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .password-toggle-btn {
        border: 1px solid !important;
        background: white !important;
        color: black !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .password-toggle-btn {
        transition: none !important;
    }
}

/* Print styles */
@media print {
    .password-toggle-btn {
        display: none !important;
    }
}