/* Custom styles for Lexi Trilingual AI Assistant */

/* Custom CSS Variables for the new color palette */
:root {
    --primary-color: #3B82F6;
    --secondary-color: #F0F4F8;
    --text-color: #111827;
    --text-secondary: #6B7280;
    --background-color: #FFFFFF;
    --hover-color: #2563EB;
    --border-color: #E5E7EB;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --sidebar-width: 280px;
    --input-bg: #FFFFFF;
    --input-border: #D1D5DB;
    --settings-card-bg: #FFFFFF;
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #60A5FA;
    --secondary-color: #1F2937;
    --text-color: #F9FAFB;
    --text-secondary: #9CA3AF;
    --background-color: #111827;
    --hover-color: #3B82F6;
    --border-color: #374151;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --input-bg: #1F2937;
    --input-border: #374151;
    --settings-card-bg: #1F2937;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
}

/* Layout Structure */
.container-fluid {
    height: calc(100vh - 76px); /* Subtract navbar height */
}

/* Top navbar styling */
.navbar {
    z-index: 1000;
    position: relative;
}

.row {
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--background-color);
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
    padding: 15px;
}

.sidebar .list-group-item {
    border: none;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.sidebar .list-group-item:hover {
    background-color: var(--secondary-color);
    transform: translateX(4px);
}

.sidebar .list-group-item.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .list-group-item.active:hover {
    background-color: var(--hover-color);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--background-color);
    overflow: hidden;
}

/* Content section base styling moved to animation section below */

/* Chat Section Specific Styling */
.chat-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
}

.chat-window {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 112px); /* Subtract navbar + chat header */
    min-height: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background-color: var(--secondary-color);
    padding: 1.5rem !important;
    scroll-behavior: smooth;
}

.chat-input {
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem !important;
}

/* Message Styling */
.message-bubble {
    margin-bottom: 1rem;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-content {
    background-color: var(--primary-color) !important;
    color: white !important;
    max-width: 70%;
    margin-left: auto;
}

.assistant-message {
    display: flex;
    justify-content: flex-start;
}

.assistant-message .message-content {
    background-color: var(--background-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color);
    max-width: 70%;
    margin-right: auto;
}

.message-content {
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* Input Styling */
#messageInput {
    resize: none;
    min-height: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

#messageInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Action Buttons */
.action-buttons {
    margin-top: 0.5rem;
}

.action-buttons .btn {
    border-radius: 1rem;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
}

/* Navigation and General Button Styling */
.navbar {
    background-color: var(--background-color) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 600;
    color: var(--text-color) !important;
}

.btn {
    transition: all 0.2s ease-in-out;
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    transform: translateY(-1px);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    color: #6B7280;
    border-color: #D1D5DB;
}

.btn-outline-secondary:hover {
    background-color: #6B7280;
    border-color: #6B7280;
    color: white;
}

/* Send Button - Modern Design */
#sendButton, .send-button {
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--translate-color));
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

#sendButton:hover, .send-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, var(--primary-hover), var(--translate-color));
}

#sendButton:active, .send-button:active {
    transform: translateY(0) scale(1.02);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

#sendButton:disabled, .send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#sendButton::before, .send-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

#sendButton:hover::before, .send-button:hover::before {
    transform: translateX(100%);
}

/* Voice Button - Minimal Design */
.voice-button {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: #6B7280;
    margin-right: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.voice-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
}

.voice-button.recording {
    border-color: #EF4444;
    color: #EF4444;
    background-color: rgba(239, 68, 68, 0.1);
    animation: pulseGlow 1.5s infinite;
}

.voice-button.processing {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.voice-button.listening {
    border-color: #10B981;
    color: #10B981;
    background-color: rgba(16, 185, 129, 0.1);
    animation: breathe 2s infinite;
}

@keyframes pulseGlow {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes breathe {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.03);
        opacity: 0.8;
    }
}

/* Text-to-speech button for messages */
.tts-button {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
}

.message:hover .tts-button {
    opacity: 1;
}

.tts-button:hover {
    color: var(--primary-color);
    background-color: var(--secondary-color);
}

.tts-button.playing {
    color: var(--primary-color);
    animation: pulse 1s infinite;
}

/* Voice Permission Tutorial */
.voice-tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.voice-tutorial.show {
    opacity: 1;
    visibility: visible;
}

.tutorial-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.voice-tutorial.show .tutorial-content {
    transform: scale(1);
}

.tutorial-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.tutorial-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tutorial-steps {
    text-align: left;
    margin: 24px 0;
}

.tutorial-step {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--secondary-color);
    border-radius: 8px;
}

.tutorial-step-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.tutorial-step-text {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}

.tutorial-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.tutorial-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-btn.primary {
    background: var(--primary-color);
    color: white;
}

.tutorial-btn.primary:hover {
    background: var(--hover-color);
}

.tutorial-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tutorial-btn.secondary:hover {
    background: var(--secondary-color);
}

/* Voice Error Tooltip */
.voice-error-tooltip {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.voice-error-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.voice-error-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1F2937;
}

.voice-error-tooltip.error {
    background: #EF4444;
}

.voice-error-tooltip.error::after {
    border-top-color: #EF4444;
}

.voice-error-tooltip.warning {
    background: #F59E0B;
}

.voice-error-tooltip.warning::after {
    border-top-color: #F59E0B;
}

.voice-error-tooltip.info {
    background: var(--primary-color);
}

.voice-error-tooltip.info::after {
    border-top-color: var(--primary-color);
}

/* Alert and Welcome Message Styling */
.alert {
    border: none;
    border-radius: 0.75rem;
    background-color: #EBF8FF;
    border-left: 4px solid var(--primary-color);
    color: var(--text-color);
}

.welcome-message {
    margin-bottom: 1rem;
}

/* Loading States */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 18px 18px 18px 4px;
    max-width: 80px;
    margin-bottom: 10px;
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #9CA3AF;
    border-radius: 50%;
    animation: typingPulse 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Draft auto-save indicator */
.draft-saved {
    font-size: 0.9rem; /* Improved mobile readability */
    color: #10B981;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.draft-saved.show {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        min-width: 60px;
    }
    
    .sidebar-text {
        display: none;
    }
    
    .sidebar .list-group-item {
        text-align: center;
        padding: 0.75rem 0.5rem;
    }
    
    .message-content {
        max-width: 85% !important;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .action-buttons .btn {
        font-size: 0.9rem; /* Improved mobile readability */
        padding: 0.75rem 1rem; /* Better touch targets */
        min-height: 44px; /* Mobile touch standard */
        min-width: 44px;
    }
    
    .chat-header h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand span {
        display: none;
    }
    
    .action-buttons .btn span {
        display: none;
    }
    
    .action-buttons .btn {
        width: 44px; /* Mobile-friendly touch target */
        height: 44px; /* Mobile-friendly touch target */
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 50%;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Dropdown Styling */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 0.5rem;
}

.dropdown-item {
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* Content Section Management */
.content-section {
    display: none;
    height: 100%;
    overflow: hidden;
}

.content-section.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Typing indicator animation */
.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0ms;
}

.typing-dots span:nth-child(2) {
    animation-delay: 200ms;
}

.typing-dots span:nth-child(3) {
    animation-delay: 400ms;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Task type indicators */
.task-indicator {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.task-correction {
    background-color: #FEF3C7;
    color: #92400E;
}

.task-translation {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.task-rewriting {
    background-color: #F3E8FF;
    color: #7C3AED;
}

.task-summarization {
    background-color: #D1FAE5;
    color: #065F46;
}

.task-conversation {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* Language selector styling */
.language-selector {
    gap: 0.25rem;
}

.language-btn {
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.language-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.language-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.language-btn.active:hover {
    background-color: var(--primary-color);
    color: white;
    opacity: 0.9;
}

/* Input group custom styling */
.input-group {
    align-items: flex-end;
}

.input-group .form-control {
    border-right: 1px solid var(--border-color);
}

/* Utility classes */
.text-primary {
    color: var(--primary-color) !important;
}

.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

/* Document indicator animation */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile-friendly enhancements */
@media (max-width: 768px) {
    /* General mobile improvements */
    body {
        font-size: 16px; /* Prevent zoom on input focus */
        -webkit-text-size-adjust: 100%;
    }
    
    /* Top navigation mobile improvements */
    .navbar {
        padding: 0.5rem 1rem;
        height: 56px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .language-btn {
        padding: 6px 12px;
        font-size: 13px;
        margin: 0 2px;
        min-height: 36px;
        touch-action: manipulation;
    }
    
    /* Main container adjustments */
    .container-fluid {
        height: calc(100vh - 56px);
        padding: 0;
    }
    
    /* Sidebar mobile improvements */
    .sidebar {
        position: fixed;
        top: 56px;
        left: -280px;
        height: calc(100vh - 56px);
        z-index: 1000;
        transition: left 0.3s ease;
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar .list-group-item {
        padding: 12px 16px;
        margin-bottom: 4px;
        font-size: 15px;
        min-height: 48px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    /* Main content mobile improvements */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 12px;
    }
    
    /* Chat area mobile improvements */
    .chat-container {
        height: calc(100vh - 140px);
        padding: 0;
    }
    
    #messages {
        padding: 8px;
        font-size: 15px;
        line-height: 1.4;
    }
    
    .message {
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 12px;
        max-width: 85%;
    }
    
    .message.user {
        margin-left: 15%;
    }
    
    .message.assistant {
        margin-right: 15%;
    }
    
    /* Input area mobile improvements */
    .input-group {
        padding: 12px;
        background: white;
        border-top: 1px solid #E5E7EB;
        position: sticky;
        bottom: 0;
        z-index: 100;
    }
    
    #messageInput {
        font-size: 16px; /* Prevent zoom */
        padding: 12px 16px;
        border-radius: 20px;
        min-height: 44px;
        resize: none;
        touch-action: manipulation;
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
        font-size: 14px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }
    
    .btn:focus {
        outline: 2px solid #3B82F6;
        outline-offset: 2px;
    }
    
    /* File upload mobile improvements */
    .file-upload-area {
        padding: 20px;
        margin: 10px 0;
        border-radius: 12px;
        touch-action: manipulation;
    }
    
    .file-upload-area.dragover {
        transform: scale(1.02);
    }
    
    /* File cards mobile improvements */
    .file-card {
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 12px;
        touch-action: manipulation;
    }
    
    .file-card .card-body {
        padding: 12px;
    }
    
    .file-card .card-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .file-card .text-muted {
        font-size: 12px;
    }
    
    /* Pencil menu mobile improvements */
    .pencil-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }
    
    .pencil-btn:focus {
        outline: 2px solid #3B82F6 !important;
        outline-offset: 2px !important;
    }
    
    /* Mobile bottom sheet for dropdown menus */
    .file-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        max-width: 100% !important;
        min-width: 100% !important;
        max-height: 60vh !important;
        z-index: 2000 !important;
        margin: 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 20px) !important;
        animation: slideUpFadeIn 0.3s ease !important;
    }
    
    .file-menu .menu-item {
        min-height: 48px !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        border-bottom: 1px solid #F1F5F9 !important;
        touch-action: manipulation !important;
    }
    
    .file-menu .menu-item i {
        width: 20px !important;
        font-size: 18px !important;
        margin-right: 12px !important;
    }
    
    @keyframes slideUpFadeIn {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Mobile floating upload button */
    .mobile-upload-fab {
        display: block;
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 20px;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
        z-index: 1000;
        transition: all 0.3s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    }
    
    .mobile-upload-fab:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    }
    
    .mobile-upload-fab:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.6);
    }
    
    .mobile-upload-fab:focus {
        outline: 3px solid rgba(59, 130, 246, 0.4);
        outline-offset: 2px;
    }
    
    /* Tone selector mobile improvements */
    .tone-selector {
        margin-bottom: 12px;
    }
    
    .tone-selector select {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Form controls mobile improvements */
    .form-control, .form-select {
        font-size: 16px;
        padding: 12px 16px;
        min-height: 44px;
        border-radius: 8px;
        touch-action: manipulation;
    }
    
    .form-control:focus, .form-select:focus {
        outline: 2px solid #3B82F6;
        outline-offset: 2px;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    /* Modal mobile improvements */
    .modal-dialog {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header, .modal-footer {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* Cards and content mobile improvements */
    .card {
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .card-header {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* List items mobile improvements */
    .list-group-item {
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 4px;
        touch-action: manipulation;
    }
    
    /* Scrollbar improvements for mobile */
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #CBD5E0;
        border-radius: 2px;
    }
    
    /* Ensure mobile menu overlay doesn't interfere with touch */
    .mobile-menu-overlay {
        touch-action: manipulation;
    }
    
    /* Typography mobile improvements */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    
    /* Accessibility improvements */
    *:focus {
        outline: 2px solid #3B82F6;
        outline-offset: 2px;
    }
    
    /* Hide scrollbars but keep functionality */
    .sidebar {
        scrollbar-width: thin;
        scrollbar-color: #CBD5E0 transparent;
    }
    
    /* Prevent horizontal scroll */
    body, html {
        overflow-x: hidden;
    }
    
    /* Safe area adjustments for iOS */
    @supports (padding: max(0px)) {
        .navbar {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
        
        .input-group {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }
}


/* Hide mobile floating button on desktop */
@media (min-width: 768px) {
    .mobile-upload-fab {
        display: none !important;
    }
}

/* Settings Page Dark Mode Styles */
.settings-container {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
}

.settings-sidebar {
    background-color: var(--settings-card-bg);
    border-right: 1px solid var(--border-color);
}

.settings-sidebar .nav-link {
    color: var(--text-color);
    border-radius: 8px;
    margin-bottom: 4px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.settings-sidebar .nav-link:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.settings-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.settings-main {
    background-color: var(--background-color);
}

.panel-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
}

.panel-title {
    color: var(--text-color);
}

.panel-description {
    color: var(--text-secondary);
}

.settings-group {
    background-color: var(--settings-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.group-title {
    color: var(--text-color);
}

.setting-item {
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    color: var(--text-color);
}

.setting-description {
    color: var(--text-secondary);
}

.form-select, .form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}

.form-select:focus, .form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-select option {
    background-color: var(--input-bg);
    color: var(--text-color);
}

.btn {
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.toggle-switch {
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
}

.toggle-switch.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.connector-card {
    background-color: var(--settings-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 180px;
    transition: all 0.3s ease;
}

.connector-card:hover:not(.disabled) {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.connector-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.connector-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.connectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.connector-info {
    margin: 12px 0;
    flex-grow: 1;
}

.connector-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.connector-icon {
    color: var(--text-secondary);
}

.connector-name {
    color: var(--text-color);
}

.connector-description {
    color: var(--text-secondary);
}

.status-badge {
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-connected {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.status-disconnected {
    background-color: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
}

.service-status.warning {
    background-color: rgba(251, 191, 36, 0.1);
    color: #F59E0B;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.service-status.connected {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.service-status.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.table-container {
    background-color: var(--settings-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.empty-state {
    color: var(--text-secondary);
}

.empty-state i {
    color: var(--text-secondary);
}

.empty-state h4 {
    color: var(--text-color);
}

.security-item {
    border-bottom: 1px solid var(--border-color);
}

.security-item:last-child {
    border-bottom: none;
}

.device-info {
    color: var(--text-color);
}

.device-icon {
    color: var(--text-secondary);
}

.security-info h4 {
    color: var(--text-color);
}

.security-info p {
    color: var(--text-secondary);
}

.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

.modal {
    background-color: var(--settings-card-bg);
    border: 1px solid var(--border-color);
}

.modal-title {
    color: var(--text-color);
}

.modal-textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}

.modal-textarea:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.toast {
    background-color: var(--settings-card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.toast.success {
    border-left: 4px solid #22C55E;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

.toast.warning {
    border-left: 4px solid #F59E0B;
}

/* Translation Modal Styling */
.translation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(4px);
}

.translation-modal {
    background: var(--background-color);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    position: relative;
}

.translation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.translation-modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.translation-modal-header .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.translation-modal-header .modal-close:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.translation-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detection-info {
    margin: 0;
    padding: 12px;
    background: var(--secondary-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.instruction {
    margin: 0;
    color: var(--text-color);
    font-weight: 500;
}

.target-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.target-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--secondary-color);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.target-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.target-btn .flag {
    font-size: 18px;
}

.target-btn .lang-name {
    flex: 1;
}

/* Responsive design for translation modal */
@media (max-width: 480px) {
    .translation-modal {
        padding: 20px;
        margin: 16px;
    }
    
    .target-buttons {
        gap: 6px;
    }
    
    .target-btn {
        padding: 10px 14px;
    }
}

/* Translation Popover Styling - Compact and Anchored */
.translation-popover {
    position: fixed;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
    max-width: 280px;
    min-width: 240px;
    z-index: 10003;
    animation: popoverSlideIn 0.2s ease-out;
    pointer-events: auto;
}

@keyframes popoverSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-8px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.popover-content {
    padding: 16px;
}

.detected-info {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--secondary-color);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
}

.detected-info strong {
    color: var(--text-color);
}

.target-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.target-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.target-options {
    display: flex;
    gap: 6px;
}

.target-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: var(--secondary-color);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 60px;
    justify-content: center;
}

.target-option:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.target-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.target-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern Translation Popover Polish */
.translation-popover {
    background: #2F2F2F !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35) !important;
    z-index: 10000 !important;
    padding: 12px 16px !important;
    animation: popoverSlideIn 120ms cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-width: 300px !important;
    min-width: 180px !important;
}

.popover-content {
    padding: 0 !important;
}

/* Friendly Header Styling */
.translation-picker-header {
    padding: 12px 16px 8px;
    color: #FFFFFF;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.target-selection {
    padding: 0 !important;
}

.target-label {
    font-weight: 500 !important;
    color: #CCCCCC !important;
    margin-bottom: 0 !important;
    font-size: 13px !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.target-options {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

/* Inline Translation Row Styling - Force horizontal layout */
.inline-translate-row {
    display: block !important;
    margin-bottom: 8px !important;
    white-space: nowrap !important;
}

.inline-translate-row .target-label {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 8px !important;
}

/* Force inline buttons to display horizontally */

.inline-translate-row:last-child {
    margin-bottom: 0;
}

/* CRITICAL: Override target-options CSS for inline layout */
.translation-popover .target-options.inline {
    display: inline-flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    align-items: center !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.translation-popover .target-options.inline .language-pill-btn {
    display: inline-flex !important;
    margin: 0 !important;
}

/* Pill Button Styling */
.language-pill-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    cursor: pointer;
    transition: all 120ms ease;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    min-height: 36px;
    min-width: 60px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.language-pill-btn.compact {
    padding: 6px 10px;
    min-height: 32px;
    min-width: 50px;
    font-size: 12px;
}

.language-pill-btn:hover {
    background: var(--primary-color, #00C896);
    border-color: var(--primary-color, #00C896);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px var(--primary-color, #00C896);
}

.language-pill-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color, #00C896);
}

.language-pill-btn:active {
    transform: translateY(0);
}

.language-pill-btn.selected {
    background: var(--primary-color, #00C896);
    border-color: var(--primary-color, #00C896);
    color: white;
    font-weight: 600;
}

.language-pill-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.lang-flag {
    font-size: 16px;
    flex-shrink: 0;
}

.lang-code {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Manual Language Selection Styling */
.manual-selection-header {
    padding: 12px 16px 8px;
    color: #FFFFFF;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.selection-note {
    font-size: 13px;
    color: #CCCCCC;
    margin-top: 4px;
}

.language-selection-step {
    padding: 16px 20px;
}

.language-selection-step:not(:last-of-type) {
    border-bottom: 1px solid var(--border-color);
}

.step-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    font-size: 14px;
}

.language-options {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.language-selection-step {
    padding: 16px 20px;
}

.language-selection-step .language-options {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    cursor: pointer;
    transition: all 120ms ease;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    min-height: 36px;
    min-width: 60px;
    justify-content: center;
}

.language-option:hover {
    background: var(--primary-color, #00C896);
    border-color: var(--primary-color, #00C896);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px var(--primary-color, #00C896);
}

.language-option.selected {
    background: var(--primary-color, #00C896);
    border-color: var(--primary-color, #00C896);
    color: white;
    font-weight: 600;
}

.language-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.language-option:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color, #00C896);
}

.lang-flag {
    font-size: 16px;
    flex-shrink: 0;
}

.lang-name {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.target-flag {
    font-size: 20px;
    line-height: 1;
}

.target-name {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
}

.popover-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
    top: -6px;
    left: 50%;
    margin-left: -6px;
}

.popover-arrow.bottom {
    top: auto;
    bottom: -6px;
    border: 1px solid var(--border-color);
    border-left: none;
    border-top: none;
}

/* Responsive design for translation popover */
@media (max-width: 480px) {
    .translation-popover {
        max-width: calc(100vw - 32px);
        min-width: 260px;
    }
    
    .popover-content {
        padding: 14px;
    }
    
    .target-option {
        padding: 8px 6px;
        min-height: 54px;
    }
    
    .target-flag {
        font-size: 18px;
    }
    
    .target-name {
        font-size: 10px;
    }
}

/* Enhanced Action Dropdown Styling with Collision Detection */
.action-dropdown {
    position: fixed; /* Changed from absolute to fixed for better portal positioning */
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    min-width: 200px;
    max-width: 320px;
    max-height: 400px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.2s ease;
    overflow-y: auto; /* Allow vertical scrolling within single container */
    overflow-x: hidden; /* Prevent horizontal overflow */
    overscroll-behavior: contain; /* Prevent scroll chaining to parent */
}

.action-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Dropdown positioning states */
.action-dropdown.dropdown-up {
    transform-origin: bottom;
}

.action-dropdown.dropdown-down {
    transform-origin: top;
}

/* Enhanced dropdown content with scrolling - removed duplicate rule */

.action-dropdown::-webkit-scrollbar {
    width: 6px;
}

.action-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.action-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.action-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Action dropdown items with improved spacing */
.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-align: left;
}

.action-dropdown-item:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.action-dropdown-item:active {
    background: var(--primary-color);
    color: white;
}

.action-dropdown-item i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
    font-size: 14px;
}

.action-dropdown-item:hover i {
    opacity: 1;
}

/* Portal container for dropdowns */
#dropdown-portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    /* Ensure portal doesn't interfere with dropdown positioning */
    width: 0;
    height: 0;
    overflow: visible;
}

#dropdown-portal > .action-dropdown {
    pointer-events: auto;
}

/* Responsive dropdown adjustments */
@media (max-width: 768px) {
    .action-dropdown {
        min-width: 180px;
        max-width: calc(100vw - 32px);
        max-height: 60vh;
    }
    
    .action-dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .action-dropdown-item i {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .action-dropdown {
        min-width: 160px;
        max-width: calc(100vw - 24px);
        max-height: 50vh;
    }
    
    .action-dropdown-item {
        padding: 12px 14px;
        gap: 10px;
    }
}

/* Enterprise Document Processing Styles */
.enterprise-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.enterprise-welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.enterprise-workflow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: center;
}

.workflow-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 8px;
}

.workflow-arrow {
    font-size: 18px;
    opacity: 0.7;
    margin: 0 8px;
}

.enterprise-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.feature-card {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.feature-icon {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.feature-description {
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.4;
}

.document-upload-zone {
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin: 20px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-upload-zone:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.supported-formats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.format-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

/* Enterprise Processing Status */
.processing-status {
    background: linear-gradient(135deg, #00C896 0%, #17B978 100%);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.processing-icon {
    font-size: 20px;
    animation: processingPulse 2s infinite;
}

@keyframes processingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.processing-text {
    flex: 1;
}

.processing-step {
    font-weight: 600;
    margin-bottom: 4px;
}

.processing-detail {
    opacity: 0.9;
    font-size: 14px;
}

/* Enterprise Results Display */
.enterprise-results {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid var(--border);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.result-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.extracted-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.data-field {
    background: var(--hover-color);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border);
}

.field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.field-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 8px 12px;
    border-radius: 6px;
}

.validation-status.success {
    background: rgba(0, 200, 150, 0.1);
    color: #00C896;
    border: 1px solid rgba(0, 200, 150, 0.2);
}

.validation-status.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.validation-status.error {
    background: rgba(220, 53, 69, 0.1);
    color: #DC3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Responsive Enterprise Styles */
@media (max-width: 768px) {
    .enterprise-workflow {
        flex-direction: column;
        gap: 16px;
    }
    
    .workflow-arrow {
        transform: rotate(90deg);
        margin: 8px 0;
    }
    
    .enterprise-features {
        grid-template-columns: 1fr;
    }
    
    .extracted-data {
        grid-template-columns: 1fr;
    }
    
    .supported-formats {
        gap: 8px;
    }
    
    .format-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* Enterprise File Menu Styling */
.enterprise-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
    border-left: 3px solid #667eea !important;
    font-weight: 500;
}

.enterprise-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
    transform: translateX(2px);
}

/* Enhanced File Menu Button Visibility */
.file-menu-btn {
    background: rgba(0, 212, 170, 0.2) !important;
    border: 2px solid #00d4aa !important;
    border-radius: 50%;
    width: 32px !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px !important;
    color: #00d4aa !important;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.file-menu-btn:hover {
    background: rgba(0, 212, 170, 0.4) !important;
    border-color: #00d4aa !important;
    transform: scale(1.2) !important;
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.5) !important;
}

.file-actions {
    position: relative;
}

.file-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--chat-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.file-menu.show {
    display: block;
    animation: fadeInScale 0.2s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
