/* ============================================
   BORTEX AI CHAT - PROFESSIONAL RESTYLING
   Color Scheme: #667eea (primary), #764ba2 (secondary)
   ============================================ */

/* Chat Container - Relative position for badge */
.chat-container {
    position: relative;
}

/* Footer Toggle - Smooth Animation */
.footer-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}



.footer-toggle.collapsed {
    transform: rotate(180deg);
}

.footer-menu {
    overflow: hidden;
    max-height: 300px;
    opacity: 1;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        margin-top 0.3s ease;
    margin-top: 8px;
}

.footer-menu.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Chat Item with Icons */
.chat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: var(--text-primary);
    font-size: 14px;
}

.chat-item i {
    width: 18px;
    color: var(--text-secondary);
    font-size: 16px;
    flex-shrink: 0;
}

.chat-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item:hover {
    background: var(--button-hover);
}

.chat-item.active {
    background: var(--bg-tertiary);
    font-weight: 500;
}

/* Sidebar Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-close-btn {
        display: block !important;
    }
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

/* Sidebar Icon Buttons */
.sidebar-icon-btn.new-chat-btn i {
    font-size: 16px;
}

/* Input Section - Modern Redesign */
.input-section {
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
}

.input-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.input-wrapper {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--input-bg);
    border-radius: var(--radius-full);
    padding: 6px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
    box-shadow: var(--shadow-md);
}

/* Actions Dropdown */
.actions-dropdown {
    position: relative;
}

.actions-trigger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.actions-trigger:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

.actions-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.actions-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 14px;
    transition: background 0.2s ease;
}

.action-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.action-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.action-item:hover {
    background: var(--bg-tertiary);
}

.action-item.active {
    color: var(--text-accent);
    background: rgba(102, 126, 234, 0.1);
}

.action-item i {
    width: 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.action-item.active i {
    color: var(--text-accent);
}

.action-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--text-secondary);
    color: white;
    font-weight: 600;
}

/* BETA Badge */
.beta-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* Premium Feature - Locked for free users */
.action-item.premium-feature.locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.action-item.premium-feature.locked::after {
    content: '🔒';
    font-size: 10px;
    margin-left: 4px;
}

.action-item.premium-feature.locked:hover {
    background: rgba(255, 100, 100, 0.1);
}

/* Disabled state - when another mode is active */
.action-item.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

/* Chat Input */
.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 24px;
    max-height: 200px;
    outline: none;
    padding: 4px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) transparent;
}

.chat-input::-webkit-scrollbar {
    width: 6px;
}

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

.chat-input::-webkit-scrollbar-thumb {
    background-color: var(--text-secondary);
    border-radius: 3px;
    opacity: 0.5;
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

/* Voice Visualizer */
.voice-visualizer {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0;
}

.voice-text {
    font-size: 14px;
    color: var(--text-accent);
    font-weight: 500;
}

.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
}

.wave-bar {
    width: 4px;
    background: var(--text-accent);
    border-radius: 2px;
    animation: wave-pulse 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave-pulse {

    0%,
    100% {
        height: 8px;
        opacity: 0.5;
    }

    50% {
        height: 32px;
        opacity: 1;
    }
}

/* Voice Button - Microphone */
.voice-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.voice-btn:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

.voice-btn.recording {
    background: #ef4444;
    color: white;
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Send Button - Modern Arrow */
.send-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
    align-self: flex-end;
    border-radius: 50%;
    border: none;
    background: var(--text-accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.send-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

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

.send-btn:disabled {
    background: var(--bg-quaternary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* FAQ Modal - Professional Design */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.faq-modal-content {
    background: var(--bg-primary);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header-custom {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.modal-header-custom h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-custom i {
    color: var(--text-accent);
}

.close-btn-custom {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn-custom:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

.modal-body-custom {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.faq-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-primary-custom {
    background: var(--text-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary-custom {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

.faq-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--text-accent);
    box-shadow: var(--shadow-sm);
}

.faq-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.faq-drag-handle {
    color: var(--text-secondary);
    cursor: grab;
    font-size: 14px;
}

.faq-drag-handle:active {
    cursor: grabbing;
}

.faq-question-input {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.faq-question-input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.faq-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.faq-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.faq-answer-input {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

.faq-answer-input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer-custom {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .faq-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header-custom,
    .modal-body-custom,
    .modal-footer-custom {
        padding: 16px;
    }

    .faq-controls {
        flex-direction: column;
    }

    .input-wrapper {
        padding: 6px 10px;
    }
}

/* Chat Item Actions */
.chat-item-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-item:hover .chat-item-actions,
.chat-item.active .chat-item-actions {
    opacity: 1;
}

/* Professional Theme Toggle */
.theme-toggle {
    border-radius: var(--radius-sm);
}

.theme-toggle:hover {
    transform: none;
}

/* Location Item */
#locationItem {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Menu */
.user-menu-wrapper {
    position: relative;
}

.user-menu-toggle {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu-toggle:hover {
    background: var(--button-hover);
}

.user-menu-toggle i {
    font-size: 16px;
    color: var(--text-accent);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
}

.user-menu-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.user-menu-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.user-menu-item:hover:not(.disabled) {
    background: var(--bg-tertiary);
}

.user-menu-item.disabled {
    color: var(--text-secondary);
    cursor: default;
    font-size: 13px;
}

.user-menu-item i {
    width: 18px;
    color: var(--text-secondary);
    font-size: 14px;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Mode Badge - Bottom Right dentro chat-container */
.mode-badge {
    position: absolute;
    bottom: 110px;
    right: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.mode-badge:hover {
    opacity: 1;
    box-shadow: var(--shadow-md);
}

.mode-badge i {
    font-size: 12px;
    color: var(--text-accent);
}

.mode-badge.thinking-mode {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--text-accent);
}

.mode-badge.thinking-mode i {
    color: var(--text-accent);
}

.mode-badge.thinking-mode span {
    color: var(--text-accent);
}

/* Guest Menu */
.guest-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

.guest-menu .btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-block;
}

.guest-menu .btn-outline-primary {
    background: transparent;
    border: 1px solid var(--text-accent);
    color: var(--text-accent);
}

.guest-menu .btn-outline-primary:hover {
    background: var(--text-accent);
    color: white;
}

.guest-menu .btn-primary {
    background: var(--text-accent);
    border: 1px solid var(--text-accent);
    color: white;
}

.guest-menu .btn-primary:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

/* ============================================
   BROWSER ELEMENTS DROPDOWN
   ============================================ */
.browser-elements-dropdown {
    position: relative;
    margin-left: 8px;
}

.elements-toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.elements-toggle-btn:hover {
    background: rgba(255, 107, 0, 0.2);
    color: #ff9500;
}

.elements-toggle-btn.has-elements {
    color: #ff9500;
}

.elements-badge {
    background: var(--accent-color);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

.elements-badge:empty,
.elements-badge[data-count="0"] {
    display: none;
}

.elements-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 280px;
    max-width: 350px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
}

.elements-dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.elements-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.elements-dropdown-header i {
    color: var(--accent-color);
    margin-right: 6px;
}

.clear-elements-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-elements-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.elements-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.no-elements-msg {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.element-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.element-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.element-item:last-child {
    margin-bottom: 0;
}

.element-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-color);
    color: white;
    text-transform: uppercase;
}

.element-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.element-saved-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-weight: 600;
}

.element-remove-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.element-item:hover .element-remove-btn {
    opacity: 1;
}

.element-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Drag Handle */
.el-drag-handle {
    cursor: grab;
    color: var(--text-tertiary);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.el-drag-handle:hover {
    color: var(--accent-color);
    background: rgba(255, 107, 0, 0.1);
}

.el-drag-handle:active {
    cursor: grabbing;
}

/* Drag States */
.element-item.dragging {
    opacity: 0.5;
    background: var(--bg-tertiary);
    border: 2px dashed var(--accent-color);
    transform: scale(0.98);
}

.element-item.drag-over {
    border-color: var(--accent-color);
    background: rgba(255, 107, 0, 0.1);
    transform: translateY(2px);
}

.element-item.drag-over::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Hide old floating button */
.elements-floating-btn {
    display: none !important;
}

/* ============================================
   CONSOLE TOGGLE & MOBILE SIZE CONTROLS
   ============================================ */

/* Bottone toggle console nel header */
.console-toggle-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
}

.console-toggle-btn:hover {
    background: var(--bg-quaternary);
    color: var(--text-primary);
}

.console-toggle-btn i {
    transition: transform 0.3s;
}

/* Console collapsed */
.browser-chat-area.collapsed {
    flex: 0 0 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    height: 36px !important;
    overflow: hidden !important;
}

.browser-chat-area.collapsed .browser-chat-messages,
.browser-chat-area.collapsed .browser-chat-input-area,
.browser-chat-area.collapsed .registered-elements-container {
    display: none !important;
}

.browser-chat-area.collapsed .browser-chat-header {
    border-bottom: none !important;
}

.browser-chat-area.collapsed .console-toggle-btn i {
    transform: rotate(180deg);
}

/* Bottone dimensione mobile - nascosto di default */
.mobile-size-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    margin-left: 8px;
}

.mobile-size-btn:hover,
.mobile-size-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

@media (max-width: 768px) {

    /* Mostra bottone dimensione solo su mobile */
    .mobile-size-btn {
        display: flex !important;
    }

    /* Dimensione medium: console più grande */
    .browser-assistant-container.mobile-medium {
        grid-template-rows: 1fr 180px !important;
    }

    /* Dimensione large: console più piccola (default) */
    .browser-assistant-container.mobile-large {
        grid-template-rows: 1fr 120px !important;
    }
}

/* ============================================
   PRESENTATION PREVIEW CARD
   Sistema di visualizzazione presentazioni in chat
   ============================================ */

.presentation-preview-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.pres-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pres-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.pres-card-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pres-card-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pres-card-badge {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pres-card-badge::before {
    content: '📊';
    font-size: 11px;
}

/* Carousel delle slide */
.pres-carousel-container {
    position: relative;
    background: var(--bg-tertiary, #0d0d1a);
    padding: 16px;
}

.pres-carousel-track {
    display: flex;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 16/9;
    background: #f5f5f5;
}

.pres-slide-preview {
    flex-shrink: 0;
    width: 100%;
    display: none;
}

.pres-slide-preview.active {
    display: block;
}

.pres-slide-content {
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.pres-slide-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.pres-slide-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 8px;
}

.pres-slide-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    font-size: 11px;
}

.pres-slide-bullets li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.pres-slide-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color, #667eea);
    font-weight: bold;
}

/* Bottoni navigazione carousel */
.pres-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    z-index: 10;
}

.pres-carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.pres-carousel-btn.prev {
    left: 20px;
}

.pres-carousel-btn.next {
    right: 20px;
}

/* Dots indicatori */
.pres-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.pres-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.pres-dot.active {
    background: var(--accent-color, #667eea);
    transform: scale(1.2);
}

.pres-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Azioni presentazione */
.pres-card-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary, #1a1a2e);
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.pres-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    background: var(--bg-tertiary, #0d0d1a);
    color: var(--text-primary, #fff);
}

.pres-action-btn:hover {
    background: var(--button-hover, rgba(255, 255, 255, 0.1));
    transform: translateY(-1px);
}

.pres-action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex: 1;
}

.pres-action-btn.primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Dropdown download */
.pres-download-dropdown {
    position: relative;
}

.pres-download-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
}

.pres-download-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pres-download-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary, #fff);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.pres-download-menu a:hover {
    background: var(--button-hover, rgba(255, 255, 255, 0.1));
}

.pres-download-menu a i {
    width: 18px;
    text-align: center;
    opacity: 0.7;
}

.pres-download-menu a i.fa-file-powerpoint {
    color: #d35e30;
}

.pres-download-menu a i.fa-file-pdf {
    color: #e74c3c;
}

.pres-download-menu a i.fa-code {
    color: #3498db;
}

/* ============================================
   PRESENTATIONS ARCHIVE MODAL
   ============================================ */

.presentations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.pres-archive-card {
    background: var(--bg-tertiary, #0d0d1a);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.pres-archive-card:hover {
    border-color: var(--accent-color, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.pres-archive-thumbnail {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
}

.pres-archive-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pres-archive-info {
    padding: 12px;
}

.pres-archive-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pres-archive-meta {
    font-size: 12px;
    color: var(--text-secondary, #888);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pres-archive-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.pres-archive-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-secondary, #1a1a2e);
    color: var(--text-primary, #fff);
}

.pres-archive-btn:hover {
    background: var(--button-hover, rgba(255, 255, 255, 0.15));
}

.pres-archive-btn.delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.pres-archive-btn.delete:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .presentation-preview-card {
        max-width: 100%;
    }

    .pres-card-actions {
        flex-direction: column;
    }

    .pres-download-menu {
        right: auto;
        left: 0;
    }

    .presentations-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ACTIVE FEATURES BAR
   Mostra le funzionalità attive sopra l'input
   ============================================ */

.active-features-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    justify-content: center;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.active-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    animation: pillPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pillPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Agent - Viola/Blu gradient */
#pillAgent {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Web Search - Verde acqua */
#pillWebSearch {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    box-shadow: 0 2px 8px rgba(56, 239, 125, 0.3);
}

/* Thinking - Blu profondo */
#pillThinking {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
}

/* Browser - Arancione */
#pillBrowser {
    background: #e58207;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

/* Device - Grigio tech */
#pillDevice {
    background: linear-gradient(135deg, #536976, #292E49);
    box-shadow: 0 2px 8px rgba(83, 105, 118, 0.4);
}

.active-feature-pill i {
    font-size: 11px;
}

/* Hover effect */
.active-feature-pill:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    cursor: default;
}

/* Dark/Light theme adjustments */
[data-theme="light"] .active-features-bar {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    margin: 0 8px 8px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .active-features-bar {
        padding: 6px 12px;
        gap: 6px;
    }

    .active-feature-pill {
        padding: 4px 10px;
        font-size: 11px;
    }

    .active-feature-pill i {
        font-size: 10px;
    }
}

/* ============================================
   ACTIVE FEATURES INLINE (inside input area)
   Pills compatte vicino al microfono
   ============================================ */

.active-features-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    flex-shrink: 0;
}

.feature-pill-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: pillPopInline 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pillPopInline {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Colori per ogni pill */
#pillAgent.feature-pill-inline {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
}

#pillWebSearch.feature-pill-inline {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
}

#pillThinking.feature-pill-inline {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

#pillBrowser.feature-pill-inline {
    background: linear-gradient(135deg, #2dce89, #1db954);
}

#pillDevice.feature-pill-inline {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* TV Connected Pill */
#pillTvConnected.feature-pill-inline {
    background: linear-gradient(135deg, #10b981, #059669);
    cursor: pointer;
    position: relative;
    animation: tvPillPulse 2s ease-in-out infinite;
}

@keyframes tvPillPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(16, 185, 129, 0.5); }
}

/* TV Pill Tooltip */
.tv-pill-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary, #1a1a2e);
    border: 1px solid var(--border-subtle, #333);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 160px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

#pillTvConnected:hover .tv-pill-tooltip {
    opacity: 1;
    visibility: visible;
}

.tv-pill-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--border-subtle, #333);
}

.tv-pill-tooltip-title {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-secondary, #888);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.tv-pill-tooltip-device {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 8px;
}

.tv-pill-tooltip-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #10b981;
}

.tv-pill-tooltip-info i {
    font-size: 11px;
}

.tv-pill-tooltip-disconnect {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle, #333);
    font-size: 10px;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tv-pill-tooltip-disconnect i {
    font-size: 9px;
}

.feature-pill-inline:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.feature-pill-inline i {
    font-size: 12px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .feature-pill-inline {
        width: 24px;
        height: 24px;
    }

    .feature-pill-inline i {
        font-size: 10px;
    }

    .active-features-inline {
        gap: 3px;
    }
}

/* ============================================
   DOCUMENT ORDER CARDS
   Cards per ricerca documenti aziendali e ordini
   ============================================ */

/* Risultati ricerca documenti */
.doc-search-results-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow: hidden;
    max-width: 500px;
}

.doc-results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.doc-results-header i {
    font-size: 18px;
    color: #3498db;
}

.doc-results-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.doc-companies-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Card singola azienda */
.doc-company-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.doc-company-card:last-child {
    border-bottom: none;
}

.doc-company-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.doc-company-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.doc-company-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.doc-company-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-company-details,
.doc-company-fiscal {
    font-size: 12px;
    color: var(--text-secondary, #888);
    display: flex;
    align-items: center;
    gap: 5px;
}

.doc-company-details i,
.doc-company-fiscal i {
    font-size: 10px;
    opacity: 0.7;
}

/* Lista documenti disponibili */
.doc-available-list {
    background: var(--bg-tertiary, #0d0d1a);
    border-radius: 8px;
    padding: 10px;
}

.doc-list-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #888);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
    background: var(--bg-secondary, #1a1a2e);
}

.doc-item:last-child {
    margin-bottom: 0;
}

.doc-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    transform: translateX(4px);
}

.doc-item-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary, #fff);
}

.doc-item-price {
    font-weight: 600;
    font-size: 13px;
    color: #2ecc71;
}

.doc-item i.fa-cart-plus {
    color: var(--accent-color, #667eea);
    font-size: 14px;
    opacity: 0.7;
    transition: all 0.15s;
}

.doc-item:hover i.fa-cart-plus {
    opacity: 1;
    transform: scale(1.1);
}

.doc-results-footer {
    padding: 10px 16px;
    font-size: 11px;
    color: var(--text-secondary, #888);
    background: var(--bg-tertiary, #0d0d1a);
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-results-footer i {
    color: #3498db;
}

/* Card ordine documento */
.doc-order-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
}

.doc-order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.doc-order-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.doc-order-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doc-order-title {
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.doc-order-company {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.doc-order-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.doc-order-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-tertiary, #0d0d1a);
}

.doc-price-label {
    font-size: 12px;
    color: var(--text-secondary, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #2ecc71;
}

.doc-order-actions {
    padding: 16px;
}

.doc-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.doc-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.doc-pay-btn:active {
    transform: translateY(0);
}

.doc-order-note {
    padding: 10px 16px;
    font-size: 11px;
    color: var(--text-secondary, #888);
    background: var(--bg-secondary, #1a1a2e);
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.doc-order-note i {
    color: #3498db;
}

/* Card documento pronto */
.doc-ready-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 2px solid #2ecc71;
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
}

.doc-ready-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.doc-ready-icon {
    font-size: 24px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.doc-ready-title {
    font-weight: 700;
    font-size: 16px;
}

.doc-ready-info {
    padding: 16px;
    text-align: center;
}

.doc-ready-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
}

.doc-ready-company {
    font-size: 13px;
    color: var(--text-secondary, #888);
}

.doc-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.doc-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.doc-ready-warning {
    padding: 10px 16px;
    font-size: 11px;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 480px) {

    .doc-search-results-card,
    .doc-order-card,
    .doc-ready-card {
        max-width: 100%;
    }

    .doc-company-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-item {
        flex-wrap: wrap;
    }

    .doc-item-name {
        width: 100%;
        margin-bottom: 4px;
    }

    .doc-price-value {
        font-size: 20px;
    }
}

/* ============================================
   VIDEO ANALYSIS CARD
   Card per analisi video YouTube con trascrizione
   ============================================ */

.video-analysis-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow: hidden;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.video-analysis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
}

.video-analysis-icon {
    font-size: 20px;
}

.video-analysis-badge {
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

.video-analysis-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
}

.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-analysis-thumbnail:hover .video-thumb-img {
    transform: scale(1.05);
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

.video-analysis-thumbnail:hover .video-play-overlay {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-analysis-meta {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.video-analysis-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-analysis-channel {
    font-size: 13px;
    color: var(--text-secondary, #888);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-analysis-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary, #888);
}

.video-analysis-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-analysis-summary {
    padding: 16px;
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.2));
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.video-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 10px;
}

.video-summary-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary, #ddd);
    max-height: 200px;
    overflow-y: auto;
}

.video-summary-content strong {
    color: var(--text-accent, #f59e0b);
}

.video-analysis-transcript-preview {
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.video-transcript-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-transcript-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.transcript-toggle-icon {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.video-transcript-content {
    padding: 0 16px 16px;
}

.video-transcript-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary, #999);
    max-height: 150px;
    overflow-y: auto;
    margin: 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    white-space: pre-wrap;
}

.video-analysis-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
}

.video-download-btn,
.video-link-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.video-download-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.video-download-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.video-link-btn {
    background: rgba(255, 0, 0, 0.15);
    color: #ff4444;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.video-link-btn:hover {
    background: rgba(255, 0, 0, 0.25);
    border-color: rgba(255, 0, 0, 0.5);
}

/* Responsive per video analysis card */
@media (max-width: 480px) {
    .video-analysis-card {
        max-width: 100%;
    }

    .video-analysis-actions {
        flex-direction: column;
    }

    .video-download-btn,
    .video-link-btn {
        width: 100%;
    }
}