/**
 * 🖥️ Desktop Fullscreen Experience Styles
 * Enhanced UI for desktop fullscreen mode
 */

/* ===== DESKTOP FULLSCREEN BUTTON ===== */
.desktop-fullscreen-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.desktop-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.desktop-fullscreen-btn:active {
    transform: translateY(0);
}

.desktop-fullscreen-btn svg {
    transition: transform 0.2s ease;
}

.desktop-fullscreen-btn:hover svg {
    transform: scale(1.1);
}

/* Tooltip */
.desktop-fullscreen-btn .tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.desktop-fullscreen-btn:hover .tooltip {
    opacity: 1;
}

/* ===== FLOATING FULLSCREEN CONTROL ===== */
.floating-fullscreen-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.floating-fullscreen-control:hover {
    opacity: 1;
}

/* ===== FULLSCREEN OVERLAY CONTROLS ===== */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.fullscreen-overlay.hidden {
    opacity: 0;
}

.fullscreen-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.fullscreen-control-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 6px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.fullscreen-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.fullscreen-control-btn:active {
    transform: scale(0.95);
}

/* ===== FULLSCREEN MODE STYLES ===== */
.fullscreen-mode {
    --fullscreen-padding: 20px;
    --fullscreen-max-width: 95vw;
    --fullscreen-chat-height: 85vh;
}

.fullscreen-mode #chat-container {
    max-height: var(--fullscreen-chat-height) !important;
    padding: var(--fullscreen-padding) !important;
    margin: 0 auto !important;
    max-width: var(--fullscreen-max-width) !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.fullscreen-mode #brainPortal {
    max-width: 90vw !important;
    max-height: 85vh !important;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
}

.fullscreen-mode .input-container {
    max-width: var(--fullscreen-max-width) !important;
    padding: var(--fullscreen-padding) !important;
    margin: 0 auto !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.fullscreen-mode header {
    padding: 15px var(--fullscreen-padding) !important;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* ===== DESKTOP OPTIMIZATIONS ===== */
.desktop-optimized {
    --desktop-hover-scale: 1.02;
    --desktop-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.desktop-optimized .message {
    transition: var(--desktop-transition);
    cursor: pointer;
    border-radius: 12px;
    padding: 16px 20px;
}

.desktop-optimized .message:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.desktop-optimized .message.bot:hover {
    background: rgba(240, 248, 255, 0.9);
    border-left: 4px solid #4a90e2;
}

.desktop-optimized .message.user:hover {
    background: rgba(248, 255, 240, 0.9);
    border-right: 4px solid #34a853;
}

.desktop-optimized button {
    transition: var(--desktop-transition);
    cursor: pointer;
}

.desktop-optimized button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.desktop-optimized button:active {
    transform: translateY(0);
}

/* ===== DESKTOP CHAT OPTIMIZATIONS ===== */
.desktop-chat {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.desktop-chat::-webkit-scrollbar {
    width: 8px;
}

.desktop-chat::-webkit-scrollbar-track {
    background: transparent;
}

.desktop-chat::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.desktop-chat::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ===== DESKTOP BRAIN PORTAL ===== */
.desktop-brain-portal {
    transition: var(--desktop-transition);
    border-radius: 16px;
    overflow: hidden;
}

.desktop-brain-portal .brain-content {
    padding: 24px;
}

.desktop-brain-portal .brain-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    font-weight: 600;
}

/* ===== NOTIFICATIONS ===== */
.desktop-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border-left: 4px solid #4a90e2;
}

.desktop-notification.show {
    transform: translateX(0);
}

.desktop-notification.success {
    border-left-color: #34a853;
    background: rgba(52, 168, 83, 0.9);
}

.desktop-notification.error {
    border-left-color: #ea4335;
    background: rgba(234, 67, 53, 0.9);
}

.desktop-notification.warning {
    border-left-color: #fbbc04;
    background: rgba(251, 188, 4, 0.9);
}

.desktop-notification.info {
    border-left-color: #4285f4;
    background: rgba(66, 133, 244, 0.9);
}

/* ===== MODAL DIALOGS ===== */
.desktop-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

/* ===== KEYBOARD SHORTCUTS DISPLAY ===== */
.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.shortcut-item kbd {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shortcut-item span {
    color: #666;
    font-size: 14px;
}

/* ===== CONTEXT MENU ===== */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    min-width: 150px;
    overflow: hidden;
    animation: contextMenuSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.context-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s ease;
}

.context-item:hover {
    background: #f5f5f5;
}

.context-item:active {
    background: #e0e0e0;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .desktop-fullscreen-btn,
    .floating-fullscreen-control,
    .fullscreen-overlay {
        display: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .desktop-fullscreen-btn {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    .desktop-fullscreen-btn:hover {
        background: rgba(0, 0, 0, 0.5);
    }
    
    .fullscreen-mode #chat-container,
    .fullscreen-mode .input-container {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }
    
    .fullscreen-mode header {
        background: rgba(20, 20, 20, 0.9);
        color: #fff;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .desktop-optimized .message:hover {
        background: rgba(40, 40, 40, 0.8);
    }
    
    .desktop-optimized .message.bot:hover {
        background: rgba(30, 40, 60, 0.9);
    }
    
    .desktop-optimized .message.user:hover {
        background: rgba(30, 60, 40, 0.9);
    }
    
    .modal-content {
        background: #2d2d2d;
        color: #fff;
    }
    
    .modal-header {
        background: #1a1a1a;
        border-bottom-color: #444;
    }
    
    .context-menu {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .context-item:hover {
        background: #404040;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .desktop-fullscreen-btn,
    .fullscreen-control-btn,
    .desktop-optimized .message,
    .desktop-optimized button,
    .desktop-notification,
    .modal-content,
    .context-menu {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus indicators for keyboard navigation */
.desktop-fullscreen-btn:focus,
.fullscreen-control-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .desktop-fullscreen-btn {
        border-width: 2px;
    }
    
    .fullscreen-control-btn {
        border: 2px solid white;
    }
    
    .desktop-notification {
        border-width: 2px;
    }
}
