/* Essential styles that complement Tailwind */

/* Background animation canvas - MUCH DARKER */
#animatedBackground {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 25%, #1a1a1a 50%, #0a0a0a 75%, #000000 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#animatedBackground canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Global scrollbar styling - DARK THEME FOR ALL CONTENT */
* {
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #000000;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #000000 !important;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%) !important;
    border-radius: 6px;
    border: 2px solid #000000;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%) !important;
}

::-webkit-scrollbar-corner {
    background: #000000 !important;
}

/* Force scrollbar styling on ALL elements including iframes and modals */
iframe::-webkit-scrollbar,
.modal::-webkit-scrollbar,
div::-webkit-scrollbar,
body::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
}

iframe::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track,
div::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
    background: #000000 !important;
    border-radius: 6px !important;
}

iframe::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
div::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%) !important;
    border-radius: 6px !important;
    border: 2px solid #000000 !important;
}

iframe::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%) !important;
}

/* Select dropdown styling for dark theme */
select option:disabled {
    font-weight: bold;
    background-color: #1f2937;
}

select option.pl-4 {
    padding-left: 1rem;
}

select option.pl-8 {
    padding-left: 2rem;
}

/* Modal animations */
.modal-enter {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glass morphism utilities - DARKER */
.glass {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-border {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Dark glassmorphism for main content */
.bg-glass {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading spinner - DARKER */
.spinner {
    border: 3px solid #1a1a1a;
    border-radius: 50%;
    border-top: 3px solid #10b981;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form input styling - ENHANCED XENOMORPH REDESIGN */
.form-input {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a) !important;
    border: 2px solid rgba(42, 42, 42, 0.8) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    padding: 14px 18px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 
                0 4px 16px rgba(0, 0, 0, 0.4),
                0 0 0 0 rgba(16, 185, 129, 0) !important;
    position: relative;
    overflow: hidden;
}

.form-input:focus {
    outline: none !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 
                0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 0 3px rgba(16, 185, 129, 0.2),
                0 0 20px rgba(16, 185, 129, 0.1) !important;
    background: linear-gradient(145deg, #0f0f0f, #1f1f1f) !important;
    transform: translateY(-1px);
}

/* Add subtle glow effect on hover */
.form-input:hover:not(:focus) {
    border-color: rgba(42, 42, 42, 1) !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 
                0 4px 18px rgba(0, 0, 0, 0.5),
                0 0 8px rgba(16, 185, 129, 0.05) !important;
    background: linear-gradient(145deg, #0c0c0c, #1c1c1c) !important;
}

/* Enhanced ripple effect for inputs */
.form-input::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.form-input:focus::before {
    left: 100%;
}

.form-input::placeholder {
    color: #666666 !important;
    opacity: 1 !important;
}

/* Fix auto-filled input styling */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0a0a0a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: #0a0a0a !important;
    border: 2px solid #2a2a2a !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #0f0f0f inset !important;
    border-color: #10b981 !important;
}

/* Select dropdown dark styling */
select.form-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
    padding-right: 40px !important;
}

/* Select option styling - DARK THEME */
select.form-input option {
    background-color: #0a0a0a !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    border: none !important;
}

select.form-input option:hover,
select.form-input option:focus,
select.form-input option:active,
select.form-input option[selected] {
    background-color: #1a1a1a !important;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a, #1a1a1a) !important;
    color: #10b981 !important;
    outline: none !important;
}

select.form-input option:checked,
select.form-input option:selected {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a, #0a0a0a) !important;
    color: #ffffff !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.2), 
                0 0 4px rgba(16, 185, 129, 0.3) !important;
}

/* Disabled options (headers) */
select.form-input option:disabled {
    background-color: #2a2a2a !important;
    color: #10b981 !important;
    font-weight: bold !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Indented options */
select.form-input option.pl-4 {
    padding-left: 24px !important;
    color: #e5e5e5 !important;
}

select.form-input option.pl-8 {
    padding-left: 48px !important;
    color: #d1d1d1 !important;
    font-size: 13px !important;
}

/* Modal improvements - MUCH DARKER */
.modal-dark {
    background: linear-gradient(145deg, #000000, #1a1a1a) !important;
    border: 2px solid #2a2a2a !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
}

/* Button improvements - XENOMORPH BLACK WITH GLOSS */
.btn-gunmetal {
    background: linear-gradient(145deg, #000000, #0a0a0a, #000000) !important;
    border: 2px solid #1a1a1a !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.9), 
                inset 0 1px 2px rgba(255, 255, 255, 0.05),
                inset 0 -2px 4px rgba(0, 0, 0, 0.8) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 12px !important;
    position: relative;
    overflow: hidden;
}

/* Xenomorph head-like gloss overlay */
.btn-gunmetal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, 
                                rgba(255, 255, 255, 0.15) 0%, 
                                rgba(255, 255, 255, 0.05) 50%, 
                                rgba(255, 255, 255, 0.02) 100%);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

/* Xenomorph shine effect */
.btn-gunmetal::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 30%;
    background: radial-gradient(ellipse at center, 
                                rgba(255, 255, 255, 0.3) 0%, 
                                rgba(255, 255, 255, 0.1) 40%, 
                                transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.8;
}

.btn-gunmetal:hover {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a, #0a0a0a) !important;
    border-color: #2a2a2a !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.95), 
                inset 0 1px 3px rgba(255, 255, 255, 0.08),
                inset 0 -3px 6px rgba(0, 0, 0, 0.9),
                0 0 20px rgba(16, 185, 129, 0.1) !important;
}

.btn-gunmetal:hover::before {
    background: linear-gradient(180deg, 
                                rgba(255, 255, 255, 0.2) 0%, 
                                rgba(255, 255, 255, 0.08) 50%, 
                                rgba(255, 255, 255, 0.03) 100%);
}

.btn-gunmetal:hover::after {
    opacity: 1;
    transform: scale(1.1);
}

/* Pre-fill button fade transitions */
#preFillButton {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
}

#preFillButton.fade-in {
    opacity: 1 !important;
    transform: scale(1) !important;
}

#preFillButton.fade-out {
    opacity: 0 !important;
    transform: scale(0.95) !important;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    /* Pre-fill modal title */
    #preFillModal h2 {
        font-size: 1.25rem !important; /* Reduced from 1.5rem (text-2xl) */
        line-height: 1.5 !important;
    }
    
    /* Template dropdown text - further reduced for mobile */
    #templateSelect {
        font-size: 0.75rem !important; /* Reduced from 0.875rem */
        line-height: 1.2 !important;
    }
    
    /* Template dropdown options - further reduced for mobile */
    #templateSelect option {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
    }
    
    /* Pre-fill modal content adjustments */
    #preFillModal .bg-gray-800 {
        padding: 1rem !important; /* Reduced padding on mobile */
    }
    
    /* Phone lookup section adjustments */
    #preFillModal .bg-purple-900 h3 {
        font-size: 1rem !important; /* Reduced from 1.125rem (text-lg) */
    }
    
    /* Field labels in pre-fill modal */
    #preFillModal .text-sm {
        font-size: 0.75rem !important; /* Reduced from 0.875rem */
    }
    
    /* Role headers in pre-fill modal */
    #preFillModal .text-lg {
        font-size: 1rem !important; /* Reduced from 1.125rem */
    }
}

@media (max-width: 480px) {
    /* Extra small screens - even more compact */
    #preFillModal h2 {
        font-size: 1.125rem !important;
    }
    
    #templateSelect {
        font-size: 0.7rem !important; /* Even smaller for very small screens */
    }
    
    #templateSelect option {
        font-size: 0.7rem !important;
    }
    
    /* Reduce modal padding even more */
    #preFillModal .bg-gray-800 {
        padding: 0.75rem !important;
    }
}

/* Z-Index Hierarchy - FORCE PROPER LAYERING */
/* Bottom navigation should be above footer but below modals */
.bottom-nav {
    z-index: 100 !important;
}

/* Footer should be lowest */
footer {
    z-index: 5 !important;
}

/* All modals should be above everything */
.modal,
#helpModal,
#preFillModal,
#advancedModal,
#bookmarkModal,
[id*="Modal"],
.fixed.z-50,
.fixed.z-[9998],
.fixed.z-[9999] {
    z-index: 9999 !important;
}

/* Modal backdrops */
.modal-backdrop,
.fixed.inset-0.bg-black {
    z-index: 9998 !important;
}



/* Ensure content spacing for bottom navigation and fix scrollbar issues */
html {
    height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    padding-bottom: 70px !important; /* Space for bottom navigation */
    overflow-x: hidden;
    overflow-y: auto;
    /* Modern browsers: hide scrollbar when not needed */
    scrollbar-gutter: stable;
}

/* Webkit scrollbar styling when visible */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb {
    background: rgba(42, 42, 42, 0.6);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.4);
}

/* Firefox - only show scrollbar when needed */
body {
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 42, 42, 0.6) transparent;
}

/* Additional modal fixes */
.modal-enter {
    z-index: 9999 !important;
}

/* Xenomorph Custom Tooltips */
.custom-tooltip {
    position: absolute;
    background: linear-gradient(145deg, #000000, #0a0a0a, #000000);
    border: 2px solid #1a1a1a;
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9), 
                inset 0 1px 2px rgba(255, 255, 255, 0.05),
                0 0 16px rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #0a0a0a;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.8));
}

.custom-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-tooltip.bottom::before {
    top: -6px;
    border-bottom: 6px solid #0a0a0a;
    border-top: none;
}

.custom-tooltip.top::before {
    top: auto;
    bottom: -6px;
    border-top: 6px solid #0a0a0a;
    border-bottom: none;
}

.custom-tooltip.left::before {
    top: 50%;
    left: auto;
    right: -6px;
    transform: translateY(-50%);
    border-left: 6px solid #0a0a0a;
    border-right: none;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.custom-tooltip.right::before {
    top: 50%;
    left: -6px;
    right: auto;
    transform: translateY(-50%);
    border-right: 6px solid #0a0a0a;
    border-left: none;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Xenomorph glow effect on hover */
.custom-tooltip.glow {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9), 
                inset 0 1px 2px rgba(255, 255, 255, 0.05),
                0 0 24px rgba(16, 185, 129, 0.4),
                0 0 8px rgba(16, 185, 129, 0.6);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Mobile tooltips for Other Recipients */
.otherRecipient {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(16, 185, 129, 0.1);
}

.otherRecipient:hover .custom-tooltip,
.otherRecipient:focus .custom-tooltip,
.otherRecipient.show-tooltip .custom-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile-specific tooltip behavior */
@media (max-width: 768px) {
    .otherRecipient {
        padding: 8px 4px;
        margin: 2px;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }
    
    .otherRecipient:active {
        background-color: rgba(16, 185, 129, 0.1);
    }
}

/* Enhanced Xenomorphic Dropdown Selection Styles */
select.form-input {
    /* Custom dropdown arrow */
    background-image: linear-gradient(45deg, transparent 50%, rgba(16, 185, 129, 0.6) 50%),
                      linear-gradient(135deg, rgba(16, 185, 129, 0.6) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px),
                         calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

select.form-input:focus {
    outline: none !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2),
                inset 0 2px 4px rgba(0, 0, 0, 0.8) !important;
}

/* Override browser-specific selection highlighting */
select.form-input option::selection {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a) !important;
    color: #ffffff !important;
}

select.form-input option::-moz-selection {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a) !important;
    color: #ffffff !important;
}

/* Firefox-specific option styling */
@-moz-document url-prefix() {
    select.form-input option:checked {
        background: linear-gradient(145deg, #0a0a0a, #1a1a1a, #0a0a0a) !important;
        color: #ffffff !important;
        box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.2) !important;
    }
}

/* Webkit-specific dropdown styling */
select.form-input::-webkit-scrollbar {
    width: 12px;
    background: #000000;
}

select.form-input::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 6px;
    border: 2px solid #000000;
}

select.form-input::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%);
}

/* Custom Dropdown Styles - Xenomorph Theme */
.custom-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.custom-dropdown-button {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-dropdown-arrow {
    color: rgba(16, 185, 129, 0.6);
    transition: all 0.2s ease;
}

.custom-dropdown-list {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8),
                0 0 20px rgba(16, 185, 129, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    max-height: 400px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

/* Scrollbar for dropdown */
.custom-dropdown-list::-webkit-scrollbar {
    width: 10px;
}

.custom-dropdown-list::-webkit-scrollbar-track {
    background: #000000;
    border-radius: 0 10px 10px 0;
}

.custom-dropdown-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 5px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.custom-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Firefox scrollbar */
.custom-dropdown-list {
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #000000;
}

.custom-dropdown-group {
    padding: 4px 0;
    display: block;
}

.custom-dropdown-header {
    display: block;
    padding: 12px 20px 8px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 1;
    cursor: default;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 4px;
    user-select: none;
    pointer-events: none;
    position: relative;
    color: #888;
}

/* Header color classes */
.custom-dropdown-header.text-primary-green {
    color: #4ade80;
}
.custom-dropdown-header.text-orange-400 {
    color: #fb923c;
}
.custom-dropdown-header.text-blue-400 {
    color: #60a5fa;
}
.custom-dropdown-header.text-yellow-400 {
    color: #facc15;
}

.custom-dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e5e5e5;
    position: relative;
    overflow: hidden;
}

.custom-dropdown-item.pl-6 {
    padding-left: 36px;
}

.custom-dropdown-item.pl-12 {
    padding-left: 60px;
    font-size: 14px;
    color: #d1d1d1;
}

/* Hover and focus states */
.custom-dropdown-item:hover,
.custom-dropdown-item.focused {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    color: #10b981;
    padding-left: 24px;
}

.custom-dropdown-item.pl-6:hover,
.custom-dropdown-item.pl-6.focused {
    padding-left: 40px;
}

.custom-dropdown-item.pl-12:hover,
.custom-dropdown-item.pl-12.focused {
    padding-left: 64px;
}

/* Ripple effect on hover */
.custom-dropdown-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent);
    transform: translateY(-50%);
    transition: width 0.3s ease;
}

.custom-dropdown-item:hover::before,
.custom-dropdown-item.focused::before {
    width: 100%;
}

/* Selected state */
.custom-dropdown-item.selected {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    color: #10b981;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.custom-dropdown-item.selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-size: 16px;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .custom-dropdown-list {
        max-height: 50vh;
    }
    
    .custom-dropdown-item {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .custom-dropdown-header {
        padding: 12px 16px 8px;
        font-size: 15px;
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    .custom-dropdown-button {
        -webkit-appearance: none;
    }
    
    .custom-dropdown-list {
        -webkit-overflow-scrolling: touch;
    }
    
    .custom-dropdown-item {
        -webkit-tap-highlight-color: rgba(16, 185, 129, 0.1);
    }
}

/* Recipient Inputs Container - Enhanced Layout */
.recipient-inputs-container {
    margin-top: 12px;
    margin-bottom: 16px;
}

/* Recipient Role Names - Heavier Font Weight */
.recipient h3 {
    font-weight: 700 !important; /* Heavy font weight for role names */
    font-size: 1.125rem !important;
    margin-bottom: 8px !important;
}

/* Mobile responsiveness for recipient inputs */
@media (max-width: 640px) {
    .recipient-inputs-container {
        flex-direction: column;
        gap: 12px !important;
    }
    
    .recipient-inputs-container .form-input {
        width: 100%;
    }
}

/* Medium screens - reduce gap slightly */
@media (max-width: 768px) and (min-width: 641px) {
    .recipient-inputs-container {
        gap: 12px !important;
    }
}

/* Kill browser default blue highlighting completely */
select.form-input option:hover,
select.form-input option:focus,
select.form-input option:active,
select.form-input option:target {
    background-color: #1a1a1a !important;
    background-image: none !important;
    color: #10b981 !important;
}

/* Additional browser-specific overrides */
select.form-input option::-webkit-any-link {
    background-color: #1a1a1a !important;
}

select.form-input option::-moz-focus-inner {
    border: 0 !important;
    background-color: #1a1a1a !important;
}

/* Force override system colors */
select.form-input option {
    background-color: #0a0a0a !important;
    background-image: none !important;
}

select.form-input option:hover {
    background-color: #1a1a1a !important;
    background-image: none !important;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a, #1a1a1a) !important;
}

/* Pre-filled field highlighting */
.prefilled-match {
    border: 2px solid #22c55e !important;
    box-shadow: 0 0 7px #22c55e !important;
    transition: border 0.3s ease-in-out, box-shadow 0.3s ease-in-out !important;
}