/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Glassmorphism effects */
.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Email item hover effect */
.email-item {
    position: relative;
    overflow: hidden;
}

.email-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
    opacity: 0;
    transition: opacity 0.2s;
}

.email-item:hover::before,
.email-item.active::before {
    opacity: 1;
}

/* Text selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* Focus visible outline */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading shimmer */
.shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile responsiveness */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 40;
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        transform: translateX(-100%);
        height: 100vh;
    }
    
    #sidebar.open {
        transform: translateX(0);
    }
}

/* Mail viewer: HTML renders inside a sandboxed iframe (see app.js). Style the shell + attachment links only. */
#emailBody {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

#emailBody iframe.email-read-iframe {
    display: block;
    width: 100%;
    min-height: 280px;
    background: #fff;
}

#emailBody .text-blue-400 {
    color: #60a5fa;
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Button press effect */
button:active {
    transform: scale(0.98);
}

/* Custom input autofill */
input:-webkit