body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    color: #111827;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.action-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #374151;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0px);
}

.copy-btn {
    background: #111827;
    color: #ffffff;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #374151;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #111827;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    white-space: nowrap;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.input-no-ring:focus {
    outline: none;
    box-shadow: none;
}

.modal-card {
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.15);
}

#modal-body iframe {
    background-color: #ffffff;
    color-scheme: light;
}

#ai-summary-container {
    animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-badge {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-code-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-weight: 700;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-code-box:hover {
    border-color: #4f46e5;
    background: #f8fafc;
    transform: translateY(-1px);
}

.ai-link-box {
    background: #4f46e5;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-link-box:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* AI INLINE ACTIONS & MOBILE SWAP */
#ai-status-wrapper {
    transition: all 0.3s ease;
}

#ai-status-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (max-width: 639px) {
    #modal-header-container.ai-active #modal-info-container,
    #modal-header-container.info-expanded #modal-actions-container {
        display: none !important;
    }
    
    #modal-header-container.ai-active #modal-actions-container {
        margin-left: 0;
        flex: 1;
        justify-content: space-between;
    }
    
    #modal-header-container.info-expanded #modal-info-container {
        flex: 1;
        margin-right: 0;
    }
    
    #ai-status-container {
        max-width: 150px; /* Prevent it from pushing actions too far on small screens */
    }
}

.ai-detecting {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4b5563;
    display: inline-block;
    width: 100px; /* Safe width to prevent shifting when dots animate */
    text-align: left;
}

.ai-header-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.ai-btn-copy {
    background: #ffffff;
    color: #000000;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-btn-copy:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.ai-btn-link {
    background: #000000;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ai-btn-link:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

@media (max-width: 640px) {
    .email-display-text {
        font-size: 1rem !important;
    }
    
    .modal-card {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    #modal-header-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .ai-header-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 9px;
    }
}
