/* Quick Actions System Styles */

/* Floating Action Button (FAB) */
.qa-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.qa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.qa-fab:active {
    transform: scale(0.95);
}

.qa-fab.qa-fab-active {
    background: var(--primary-dark, #0056b3);
    transform: rotate(45deg);
}

.qa-fab-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

/* Overlay */
.qa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.qa-overlay.qa-overlay-visible {
    opacity: 1;
    visibility: visible;
}

/* Quick Actions Menu */
.qa-menu {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    max-height: 480px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
}

.qa-menu.qa-menu-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.qa-menu-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Search Input */
.qa-search {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    font-size: 16px;
    outline: none;
    background: #f5f5f5;
}

.qa-search:focus {
    background: white;
    border-bottom-color: var(--primary-color, #007bff);
}

/* Suggestions Section */
.qa-suggestions {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.qa-suggestions h3 {
    padding: 0 20px;
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

.qa-suggestions-list,
.qa-actions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

/* Action Items */
.qa-suggestion-item,
.qa-action-item {
    margin: 0;
}

.qa-action-button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.qa-action-button:hover {
    background-color: #f5f5f5;
}

.qa-action-button:focus {
    background-color: #e3f2fd;
    outline: none;
}

.qa-action-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.qa-action-content {
    flex: 1;
    min-width: 0;
}

.qa-action-label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.qa-action-description {
    display: block;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qa-action-shortcut {
    font-size: 11px;
    padding: 2px 6px;
    background: #e0e0e0;
    border-radius: 4px;
    color: #666;
    white-space: nowrap;
}

/* Keyboard Shortcuts Overlay */
.keyboard-shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.keyboard-shortcuts-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.keyboard-shortcuts-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

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

.keyboard-shortcuts-header h2 {
    margin: 0;
    font-size: 20px;
}

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

.keyboard-shortcuts-close:hover {
    background: #f5f5f5;
}

.keyboard-shortcuts-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.keyboard-shortcuts-search {
    margin-bottom: 20px;
}

.keyboard-shortcuts-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.keyboard-shortcuts-search input:focus {
    border-color: var(--primary-color, #007bff);
}

.keyboard-shortcuts-category {
    margin-bottom: 24px;
}

.keyboard-shortcuts-category h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 12px 0;
}

.keyboard-shortcuts-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.keyboard-shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.keyboard-shortcut-keys {
    display: flex;
    gap: 4px;
    margin-right: 16px;
}

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

.keyboard-shortcut-description {
    flex: 1;
    color: #333;
}

.keyboard-shortcuts-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.keyboard-shortcuts-customize {
    padding: 8px 16px;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.keyboard-shortcuts-customize:hover {
    background: var(--primary-dark, #0056b3);
}

/* Keyboard Feedback */
.keyboard-feedback {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2001;
    animation: fadeIn 0.3s ease;
}

.keyboard-feedback-fade {
    animation: fadeOut 0.3s ease forwards;
}

.keyboard-recording-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 32px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    z-index: 2002;
}

/* Voice Command Button */
.voice-command-button {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    color: var(--primary-color, #007bff);
    border: 2px solid var(--primary-color, #007bff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.voice-command-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.voice-command-button.listening {
    background: var(--primary-color, #007bff);
    color: white;
    animation: pulse 1.5s infinite;
}

.voice-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.voice-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: none;
}

.voice-command-button.listening .voice-pulse {
    animation: voicePulse 1.5s infinite;
}

/* Voice Visualizer */
.voice-visualizer {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.voice-visualizer.active {
    opacity: 1;
    visibility: visible;
}

.voice-visualizer-content {
    text-align: center;
}

.voice-waveform {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: 40px;
    margin-bottom: 16px;
}

.voice-waveform span {
    width: 4px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.voice-visualizer.speaking .voice-waveform span {
    animation: wave 0.8s ease-in-out infinite;
    background: var(--primary-color, #007bff);
}

.voice-visualizer.speaking .voice-waveform span:nth-child(2) {
    animation-delay: 0.1s;
}

.voice-visualizer.speaking .voice-waveform span:nth-child(3) {
    animation-delay: 0.2s;
}

.voice-visualizer.speaking .voice-waveform span:nth-child(4) {
    animation-delay: 0.3s;
}

.voice-visualizer.speaking .voice-waveform span:nth-child(5) {
    animation-delay: 0.4s;
}

.voice-transcript {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    min-height: 24px;
}

.voice-status {
    font-size: 14px;
    color: #666;
}

/* Voice Privacy Dialog */
.voice-privacy-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.voice-privacy-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
}

.voice-privacy-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
}

.voice-privacy-content p {
    margin: 0 0 12px 0;
    color: #666;
}

.voice-privacy-content ul {
    margin: 0 0 24px 0;
    padding-left: 20px;
    color: #666;
}

.voice-privacy-content li {
    margin-bottom: 4px;
}

.voice-privacy-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.voice-privacy-deny,
.voice-privacy-allow {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.voice-privacy-deny {
    background: #f5f5f5;
    color: #666;
}

.voice-privacy-deny:hover {
    background: #e0e0e0;
}

.voice-privacy-allow {
    background: var(--primary-color, #007bff);
    color: white;
}

.voice-privacy-allow:hover {
    background: var(--primary-dark, #0056b3);
}

/* Voice Help Dialog */
.voice-help-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    z-index: 2001;
}

.voice-help-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.voice-help-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.voice-help-content li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.voice-help-close {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.voice-help-close:hover {
    background: #e0e0e0;
}

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 currentColor;
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

@keyframes voicePulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 40px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .qa-menu {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        bottom: 80px;
    }
    
    .voice-command-button {
        right: 80px;
        bottom: 28px;
        width: 40px;
        height: 40px;
    }
    
    .qa-fab {
        width: 48px;
        height: 48px;
        bottom: 24px;
        right: 24px;
    }
    
    .keyboard-shortcuts-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .voice-visualizer {
        width: calc(100vw - 40px);
        bottom: 90px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) and (prefers-color-scheme: light) {
    .qa-menu,
    .keyboard-shortcuts-modal,
    .voice-visualizer,
    .voice-privacy-content,
    .voice-help-dialog {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .qa-search,
    .keyboard-shortcuts-search input {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .qa-action-button:hover {
        background-color: #2a2a2a;
    }
    
    .qa-action-label {
        color: #e0e0e0;
    }
    
    .qa-action-description,
    .voice-status {
        color: #aaa;
    }
    
    .keyboard-shortcut-keys kbd {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .voice-command-button {
        background: #1e1e1e;
        border-color: var(--primary-color, #007bff);
    }
}

/* Notification Styles for Quick Actions */
.qa-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #333;
    color: white;
    border-radius: 24px;
    font-size: 14px;
    z-index: 2000;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.qa-notification-success {
    background: #4caf50;
}

.qa-notification-error {
    background: #f44336;
}

.qa-notification-info {
    background: #2196f3;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}