/* Font loaded via preconnect in HTML with font-display: swap */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== ENHANCED VISUAL STYLES ===== */

/* Modern glassmorphism effects with enhanced depth */
.glass-effect {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(55, 65, 81, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 -1px 0 rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s ease;
}

.glass-effect:hover {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 -1px 0 rgba(255, 255, 255, 0.15) inset;
}

.glass-card {
    backdrop-filter: blur(25px) saturate(180%);
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

/* Animated gradient background with aurora effect */
.gradient-bg {
    background: linear-gradient(-45deg, #0f0f23, #1a1a2e, #16213e, #0f0f23);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
}

/* Aurora overlay effect */
.gradient-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.copy-pulse {
    animation: copyPulse 0.6s ease-out;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(34, 197, 94, 0.5); }
    100% { transform: scale(1); }
}

/* Modern button styles */
.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: linear-gradient(135deg, #374151, #4b5563);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #6b7280);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(75, 85, 99, 0.4);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

.btn-gradient {
    background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b);
    background-size: 200% 200%;
    animation: gradientAnimation 3s ease infinite;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.5);
}

.btn-gradient:active {
    transform: translateY(0) scale(0.98);
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Email list enhancements */
.email-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    background: rgba(31, 41, 55, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    display: block;
    width: 100%;
}

.email-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 0.75rem 0 0 0.75rem;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.email-item:hover::before {
    transform: scaleY(1);
}

.email-item:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateX(6px) scale(1.01);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.email-item:active {
    transform: translateX(4px) scale(0.99);
}

/* Fix text overflow in email items */
.email-item h4,
.email-item p {
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
}

/* Ensure proper line clamping */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrolling notification */
.notification-scroll {
    animation: scroll 12s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(55, 65, 81, 0.3);
    border-radius: 3px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 3px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* Enhanced dropdown */
.dropdown-enter {
    animation: dropdownEnter 0.3s ease-out;
}

@keyframes dropdownEnter {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modern toggle switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #374151;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #10b981;
}

.toggle-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active .toggle-handle {
    transform: translateX(30px);
}

/* Responsive improvements */
@media (max-width: 640px) {
    #account-dropdown {
        width: calc(100vw - 2rem);
        max-width: 20rem;
        right: -0.5rem;
    }

    /* Adjust header for mobile */
    header h1 {
        font-size: 1.5rem !important;
    }

    header .w-14 {
        width: 3rem !important;
        height: 3rem !important;
    }

    #account-btn {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    /* Smaller buttons on mobile */
    .btn-primary, .btn-secondary, .btn-gradient {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.875rem;
    }

    /* Adjust email input size */
    #addr {
        font-size: 1rem !important;
    }

    /* Make modals more mobile-friendly */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 320px) {
    #account-dropdown {
        width: calc(100vw - 1rem);
        right: -1rem;
        padding: 0.75rem;
    }

    header h1 {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
        gap: 0.75rem;
    }

    .mobile-full {
        width: 100%;
    }

    /* Adjust container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Stack header items on smaller screens */
    header {
        padding: 1rem !important;
    }

    /* Better modal sizing */
    #email-view-modal .glass-effect {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    /* Improve notification bar */
    .notification-scroll {
        font-size: 0.8rem;
    }
}

@media (min-width: 1024px) {
    /* Add hover effects only on desktop */
    .email-item::after {
        content: 'Click to view';
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        transition: opacity 0.3s ease;
        font-size: 0.875rem;
        color: #10b981;
    }

    .email-item:hover::after {
        opacity: 1;
    }
}
/* Styles for rendered HTML content in email body */
#email-body a {
    color: #2dd4bf;
    text-decoration: underline;
}
#email-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Modern Account Dropdown Styles */
#account-dropdown {
    backdrop-filter: blur(20px) saturate(180%);
}

#account-dropdown #addr1,
#account-dropdown #passw1 {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Copy message animation */
#copy-message.show-copied {
    opacity: 1 !important;
    animation: successPop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blur-sm {
    filter: blur(4px);
    transition: filter 0.3s ease;
}

.blur-sm:hover {
    filter: blur(0);
}

.copy-message {
    opacity: 0;
    transition: opacity 0.3s;
}

.show-copied {
    opacity: 1;
}

.select-all {
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, rgba(55, 65, 81, 0.3) 25%, rgba(75, 85, 99, 0.4) 50%, rgba(55, 65, 81, 0.3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    color: rgba(75, 85, 99, 0.5);
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.15rem 0.4rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Card hover glow */
.card-glow:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

/* ===== ENHANCED UI COMPONENTS ===== */

/* Glowing border effect for important sections */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #10b981, #3b82f6, #8b5cf6, #10b981);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: glowBorder 6s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-border:hover::before {
    opacity: 1;
}

@keyframes glowBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating animation for icons */
.float-icon {
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Pulsing glow for active elements */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 0 40px rgba(16, 185, 129, 0.3);
    }
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shimmer effect for loading states */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

@keyframes shimmerMove {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced icon containers */
.icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-container::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: inherit;
    filter: blur(15px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.icon-container:hover::after {
    opacity: 0.5;
}

/* Badge with dot indicator */
.badge-dot {
    position: relative;
}

.badge-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    border: 2px solid #111827;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Hover lift effect */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Interactive card with perspective */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: rotateX(2deg) rotateY(2deg) translateY(-4px);
}

/* Neon underline effect */
.neon-underline {
    position: relative;
}

.neon-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.neon-underline:hover::after {
    width: 100%;
}

/* Gradient border animation */
.animated-border {
    position: relative;
    background: linear-gradient(#111827, #111827) padding-box,
                linear-gradient(135deg, #10b981, #3b82f6, #8b5cf6) border-box;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Status indicator with animation */
.status-online {
    position: relative;
}

.status-online::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* Ripple effect on click */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
    opacity: 1;
    transition: width 0.4s ease-out, height 0.4s ease-out, opacity 0.4s ease-out;
}

/* Feature card with icon highlight */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

/* Enhanced table styles */
table {
    border-collapse: separate;
    border-spacing: 0;
}

table thead tr {
    background: rgba(55, 65, 81, 0.3);
}

table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Improved checkbox/radio styling */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #10b981;
    cursor: pointer;
}

/* Selection styling */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: #fff;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Smooth page transitions */
.page-transition {
    animation: pageEnter 0.5s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered children animation */
.stagger-children > * {
    opacity: 0;
    animation: staggerFade 0.4s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

@keyframes staggerFade {
    to {
        opacity: 1;
    }
}

/* Typing cursor effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Progress bar animation */
.progress-bar {
    position: relative;
    height: 4px;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Countdown timer styling */
.countdown {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

/* Enhanced link styling */
a:not(.btn-primary):not(.btn-secondary):not(.btn-gradient) {
    position: relative;
    transition: color 0.2s ease;
}

/* Code block styling */
code, pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
}

pre {
    padding: 1rem;
    overflow-x: auto;
}

/* Blockquote styling */
blockquote {
    border-left: 4px solid #10b981;
    padding-left: 1rem;
    margin-left: 0;
    color: #9ca3af;
    font-style: italic;
}

/* HR styling */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(75, 85, 99, 0.5), transparent);
    margin: 2rem 0;
}

/* Smooth focus states */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    transition: all 0.2s ease;
}

/* Better modal animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(17, 24, 39, 0.95);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Success message animation */
@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-message {
    animation: successPop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Improved scrollbar for all elements */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.5) rgba(55, 65, 81, 0.3);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(55, 65, 81, 0.3);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* Domain select dropdown styling */
#domain-select {
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

#domain-select option {
    padding: 0.5rem;
    background: rgba(55, 65, 81, 0.95);
    color: white;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#domain-select:focus {
    outline: none;
}

/* Comprehensive Mobile Responsive Improvements */
@media (max-width: 768px) {
    /* Container and padding adjustments */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Header improvements */
    header.glass-effect {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    /* Logo and title */
    h1#page-title {
        font-size: 1.25rem !important;
        line-height: 1.5rem !important;
    }

    .w-14.h-14 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    .w-14.h-14 i {
        font-size: 1.25rem !important;
    }

    #page-subtitle {
        font-size: 0.7rem !important;
    }

    /* Header buttons spacing */
    header .flex.items-center.space-x-3 {
        gap: 0.5rem !important;
    }

    /* Account button */
    #account-btn {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    #user-initial {
        font-size: 0.875rem !important;
    }

    /* Language and settings buttons on mobile */
    #language-toggle {
        padding: 0.625rem !important;
    }

    #language-toggle span {
        display: none !important;
    }

    #language-toggle i {
        font-size: 1rem !important;
    }

    #menu-button {
        padding: 0.625rem !important;
    }

    #menu-button i {
        font-size: 1rem !important;
    }

    /* Notification banner */
    .notification-scroll {
        font-size: 0.75rem !important;
    }

    .notification-scroll kbd {
        font-size: 0.625rem !important;
        padding: 0.125rem 0.375rem !important;
    }

    /* Account dropdown positioning */
    #account-dropdown {
        width: calc(100vw - 2rem) !important;
        right: -0.5rem !important;
        max-width: 20rem !important;
    }

    /* Email display section */
    #email-display {
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
    }

    #copy-btn {
        padding: 0.625rem 1rem !important;
        font-size: 0.75rem !important;
    }

    /* Action buttons */
    .btn-primary,
    .btn-secondary,
    .btn-gradient {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
    }

    /* Email list items */
    .email-item {
        padding: 0.75rem !important;
    }

    .email-item .text-2xl {
        font-size: 1.25rem !important;
    }

    /* Modal improvements */
    #register-modal .glass-effect,
    #login-modal .glass-effect,
    #email-modal .glass-effect {
        padding: 1.25rem !important;
        margin: 0.5rem !important;
        max-width: calc(100vw - 1rem) !important;
    }

    #register-modal h3,
    #login-modal h3,
    #email-modal h3 {
        font-size: 1.5rem !important;
    }

    /* Modal icon size */
    #register-modal .w-14,
    #login-modal .w-14,
    #email-modal .w-14 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    #register-modal .w-14 i,
    #login-modal .w-14 i,
    #email-modal .w-14 i {
        font-size: 1rem !important;
    }

    /* Form inputs */
    input[type="text"],
    input[type="password"],
    select {
        font-size: 0.875rem !important;
        padding: 0.75rem !important;
    }

    #domain-select {
        font-size: 0.875rem !important;
        padding: 0.75rem !important;
    }

    /* Modal close button */
    #close-register-x,
    #close-login-x,
    #close-email-x {
        width: 2rem !important;
        height: 2rem !important;
    }

    /* Inbox section */
    section.glass-effect {
        padding: 1rem !important;
    }

    section h2 {
        font-size: 1.25rem !important;
    }

    /* Status badge */
    .bg-green-500\/20 {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.625rem !important;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem 1rem !important;
    }

    .empty-state-icon {
        font-size: 2.5rem !important;
    }

    .empty-state h3 {
        font-size: 1rem !important;
    }

    .empty-state p {
        font-size: 0.75rem !important;
    }

    /* Settings Modal (#fullscreen-menu) Mobile Responsiveness */
    #fullscreen-menu .glass-effect.modal-content {
        padding: 1.5rem !important;
        margin: 1rem !important;
        max-width: calc(100vw - 2rem) !important;
    }

    /* Settings modal header */
    #fullscreen-menu .text-4xl {
        font-size: 1.75rem !important;
    }

    #fullscreen-menu .text-lg {
        font-size: 0.875rem !important;
    }

    /* Settings modal icon */
    #fullscreen-menu .w-16.h-16 {
        width: 3rem !important;
        height: 3rem !important;
    }

    #fullscreen-menu .w-16.h-16 i {
        font-size: 1.25rem !important;
    }

    /* Settings cards */
    #fullscreen-menu .glass-card {
        padding: 1rem !important;
    }

    /* Language button in settings */
    #language-setting {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }

    #language-setting i {
        font-size: 1rem !important;
    }

    /* Auto-refresh toggle in settings */
    #settings-auto-refresh-toggle {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Quick Links section */
    #fullscreen-menu .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    #fullscreen-menu .glass-card.p-4 {
        padding: 0.875rem !important;
    }

    #fullscreen-menu .text-sm {
        font-size: 0.8125rem !important;
    }

    /* Settings close button */
    #close-menu {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    #close-menu i {
        font-size: 1.125rem !important;
    }

    /* Decorative gradients in settings modal */
    #fullscreen-menu .absolute.w-64.h-64 {
        width: 10rem !important;
        height: 10rem !important;
    }

    /* Footer text in settings */
    #fullscreen-menu .text-gray-500 {
        font-size: 0.75rem !important;
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 480px) {
    /* Further reduce spacing */
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        padding-top: 0.5rem !important;
    }

    /* Even smaller header */
    h1#page-title {
        font-size: 1.125rem !important;
    }

    /* Hide subtitle on very small screens */
    #page-subtitle {
        display: none !important;
    }

    /* Stack buttons vertically */
    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .mobile-stack button,
    .mobile-full {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Full width action buttons */
    .btn-primary,
    .btn-secondary,
    .btn-gradient {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Reduce modal padding even more */
    #register-modal .glass-effect,
    #login-modal .glass-effect,
    #email-modal .glass-effect {
        padding: 1rem !important;
    }

    /* Settings Modal for extra small screens */
    #fullscreen-menu .glass-effect.modal-content {
        padding: 1rem !important;
        margin: 0.5rem !important;
    }

    #fullscreen-menu .text-4xl {
        font-size: 1.5rem !important;
    }

    #fullscreen-menu .text-lg {
        font-size: 0.8125rem !important;
    }

    #fullscreen-menu .w-16.h-16 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    #fullscreen-menu .w-16.h-16 i {
        font-size: 1.125rem !important;
    }

    #fullscreen-menu .glass-card {
        padding: 0.875rem !important;
    }

    #language-setting,
    #settings-auto-refresh-toggle {
        padding: 0.625rem 0.875rem !important;
        font-size: 0.8125rem !important;
    }

    #fullscreen-menu .glass-card.p-4 {
        padding: 0.75rem !important;
    }

    #fullscreen-menu .text-sm {
        font-size: 0.75rem !important;
    }

    #close-menu {
        width: 2rem !important;
        height: 2rem !important;
    }

    #fullscreen-menu .absolute.w-64.h-64 {
        width: 8rem !important;
        height: 8rem !important;
    }

    /* Smaller decorative gradients */
    .absolute.w-64.h-64 {
        width: 8rem !important;
        height: 8rem !important;
    }

    /* Email input smaller font on mobile */
    #addr {
        font-size: 0.875rem !important;
    }
}

/* Landscape mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    /* Optimize for landscape viewing */
    header.glass-effect {
        padding: 0.75rem !important;
    }

    .w-14.h-14 {
        width: 2rem !important;
        height: 2rem !important;
    }

    section.glass-effect {
        padding: 0.875rem !important;
    }
}

/* Tablet improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 48rem !important;
    }

    /* Slightly smaller elements for tablets */
    h1#page-title {
        font-size: 1.75rem !important;
    }

    .btn-primary,
    .btn-secondary,
    .btn-gradient {
        padding: 0.875rem 1.5rem !important;
    }
}

/* Touch device improvements (all mobile/tablet) */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button {
        min-height: 2.75rem !important;
    }

    /* Better tap feedback */
    button:active {
        transform: scale(0.97) !important;
    }

    /* Disable hover effects on touch devices */
    .hover\:scale-105:hover {
        transform: scale(1) !important;
    }

    /* Make links and buttons easier to tap */
    a, button, input, select {
        -webkit-tap-highlight-color: rgba(16, 185, 129, 0.2);
    }
}