/* Voice Command Log UI Styles */

/* Toggle Button */
.voice-log-toggle {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.voice-log-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.4);
}

.voice-log-toggle svg {
    width: 24px;
    height: 24px;
    color: white;
}

.voice-log-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

/* Log Panel */
.voice-log-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.voice-log-panel.open {
    right: 0;
}

/* Header */
.voice-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    color: white;
}

.voice-log-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.voice-log-actions {
    display: flex;
    gap: 8px;
}

.voice-log-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-log-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.voice-log-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.voice-log-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stats */
.voice-log-stats {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.voice-log-stat {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.voice-log-stat.success {
    border-color: #27ae60;
}

.voice-log-stat.unhandled {
    border-color: #c0392b;
}

.voice-log-stat.error {
    border-color: #c0392b;
}

.voice-log-stat.rate {
    border-color: #3498db;
}

.voice-log-stat .stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.voice-log-stat .stat-label {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* Tabs */
.voice-log-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #fafafa;
}

.voice-log-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.voice-log-tab:hover {
    background: #f0f0f0;
    color: #333;
}

.voice-log-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: white;
}

/* Content */
.voice-log-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.voice-log-tab-content {
    display: none;
    padding: 15px;
}

.voice-log-tab-content.active {
    display: block;
}

.voice-log-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* Log Entry */
.voice-log-entry {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.voice-log-entry.conversation {
    border-left-width: 6px;
}

.voice-log-entry:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.voice-log-entry.success {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.voice-log-entry.unhandled {
    border-left-color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}

.voice-log-entry.error {
    border-left-color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}

.log-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.log-entry-icon {
    font-size: 16px;
}

.log-entry-transcript {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.log-entry-time {
    font-size: 11px;
    color: #999;
}

.log-copy-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.log-copy-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

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

.log-raw-data {
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.log-entry-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.log-detail-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
}

.log-detail-result {
    font-size: 12px;
    color: #27ae60;
}

.log-detail-error {
    font-size: 12px;
    color: #c0392b;
}

.log-detail-reason {
    font-size: 12px;
    color: #c0392b;
}

/* Feature Request */
.voice-feature-request {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid #e0e0e0;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feature-action {
    font-weight: 600;
    color: #3498db;
    font-size: 15px;
}

.feature-count {
    background: #c0392b;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.feature-examples {
    font-size: 13px;
    color: #666;
}

.feature-examples strong {
    display: block;
    margin-bottom: 6px;
    color: #333;
}

.feature-examples ul {
    margin: 0;
    padding-left: 20px;
}

.feature-examples li {
    margin-bottom: 4px;
    color: #333;
}

.feature-time {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

/* Conversation Steps */
.log-conversation-steps {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
}

.conversation-header {
    font-size: 12px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 8px;
}

.conversation-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
}

.step-number {
    font-weight: 600;
    color: #999;
    min-width: 20px;
}

.step-text {
    font-style: italic;
    color: #333;
}

.step-badge {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #3498db;
}

.step-result {
    color: #27ae60;
    font-size: 11px;
}

.step-error {
    color: #c0392b;
    font-size: 11px;
}

.conversation-final {
    margin-top: 8px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 12px;
    color: #333;
}

.conversation-final strong {
    color: #3498db;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .voice-log-panel {
        width: 100%;
        right: -100%;
    }

    .voice-log-toggle {
        bottom: 150px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .voice-log-stats {
        flex-wrap: wrap;
    }

    .voice-log-stat {
        flex: 0 0 calc(50% - 5px);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .voice-log-panel {
        background: #2c2c2c;
    }

    .voice-log-entry {
        background: #3c3c3c;
        border-color: #555;
    }

    .voice-log-entry.success {
        background: rgba(39, 174, 96, 0.15);
    }

    .voice-log-entry.unhandled {
        background: rgba(192, 57, 43, 0.15);
    }

    .voice-log-entry.error {
        background: rgba(192, 57, 43, 0.15);
    }

    .log-entry-transcript,
    .feature-action {
        color: #e0e0e0;
    }

    .log-detail-badge {
        background: #444;
        color: #ccc;
    }

    .voice-feature-request {
        background: rgba(192, 57, 43, 0.15);
        border-color: #555;
        border-left-color: #c0392b;
    }
}

/* Tab Version Styles (replaces fixed panel) */
.voice-log-panel-tab {
    width: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#voiceLogContainer {
    width: 100%;
    height: 100%;
    padding: 20px;
}

/* Remove fixed positioning and sliding animations for tab view */
.voice-log-panel-tab .voice-log-header {
    position: relative;
}

.voice-log-panel-tab .voice-log-content {
    max-height: none;
    flex: 1;
}
