/* 
 * Mercer POC - Custom Styles
 * Complementary styles to Tailwind CSS
 */

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Email list item hover effects */
.email-item {
    transition: all 0.2s ease-in-out;
}

.email-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .email-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Selected email styles */
.email-item.selected {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateX(2px);
}

.dark .email-item.selected {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Message bubbles for AI chat */
.message {
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* Attachment item styles */
.attachment-item {
    transition: all 0.2s ease-in-out;
}

.attachment-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Modal backdrop blur */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background-color: #dcfce7;
    border: 1px solid #16a34a;
    color: #15803d;
}

.notification.error {
    background-color: #fef2f2;
    border: 1px solid #dc2626;
    color: #dc2626;
}

.notification.info {
    background-color: #dbeafe;
    border: 1px solid #2563eb;
    color: #1d4ed8;
}

/* Dark mode notification colors */
.dark .notification.success {
    background-color: #14532d;
    border-color: #16a34a;
    color: #22c55e;
}

.dark .notification.error {
    background-color: #7f1d1d;
    border-color: #dc2626;
    color: #f87171;
}

.dark .notification.info {
    background-color: #1e3a8a;
    border-color: #2563eb;
    color: #60a5fa;
}

/* Custom scrollbar for WebKit browsers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background-color: #f3f4f6;
    border-radius: 3px;
}

.dark .custom-scrollbar::-webkit-scrollbar-track {
    background-color: #1f2937;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .notification {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .email-item {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .slide-in,
    .email-item,
    .attachment-item {
        animation: none;
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: #000 !important;
        background: #fff !important;
    }
    
    .dark-mode-toggle,
    .user-menu,
    .ai-assistant {
        display: none !important;
    }
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dark .text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Main content height excluding header */
.main-content-height {
    height: calc(100vh - 66px);
}

/* Task area collapse/expand functionality */
.task-content-expanded {
    max-height: none;
    opacity: 1;
    overflow: visible;
    transition: all 0.3s ease-in-out;
}

.task-content-collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

#toggle-task-area {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

#toggle-task-area:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.dark #toggle-task-area:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Focus states for accessibility */
.focus-visible:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom button hover states */
button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.2s ease-in-out, 
                border-color 0.2s ease-in-out, 
                color 0.2s ease-in-out;
}

header h1 {
    margin: 0;
}

/* Inbox Styles */
.inbox {
    display: flex;
}

.inbox .email-list {
    width: 30%;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    max-height: 80vh;
}

.inbox .email-list .email-item {
    padding: 10px;
    cursor: pointer;
}

.inbox .email-list .email-item.unread {
    background-color: #e9ecef;
}

.inbox .email-content {
    width: 70%;
    padding: 20px;
}

/* Textarea Styles */
textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
}

/* Button Styles */
button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button.primary {
    background-color: #007bff;
    color: white;
}

button.secondary {
    background-color: #6c757d;
    color: white;
}



/* AI Button Disabled State */
button[disabled] {
    pointer-events: none;
    transition: all 0.3s ease;
}

button[disabled]:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* AI Input Disabled State */
textarea[disabled], input[disabled] {
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Smooth transition for button states */
#send-ai {
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
}

#send-ai:not([disabled]):hover {
    transform: translateY(-1px);
}

#send-ai:not([disabled]):active {
    transform: translateY(0px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .inbox {
        flex-direction: column;
    }

    .inbox .email-list,
    .inbox .email-content {
        width: 100%;
    }
}