/**
 * WP Gemini Live Audio - Unified Styles
 * Version: 3.0.0
 */

/* ==========================================================================
   Live Audio Widget Styles
   ========================================================================== */

.gemini-live-audio-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.gemini-live-audio-widget .status-bar {
    background: #0073aa;
    color: white;
    padding: 10px;
    text-align: center;
}

.gemini-live-audio-widget .controls {
    text-align: center;
    padding: 20px;
    background: #fff;
}

.gemini-live-audio-widget .start-conversation-btn,
.gemini-live-audio-widget .stop-conversation-btn {
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
    transition: background-color 0.3s ease;
}

.gemini-live-audio-widget .start-conversation-btn {
    background: #28a745;
    color: white;
}

.gemini-live-audio-widget .start-conversation-btn:hover {
    background: #218838;
}

.gemini-live-audio-widget .stop-conversation-btn {
    background: #dc3545;
    color: white;
}

.gemini-live-audio-widget .stop-conversation-btn:hover {
    background: #c82333;
}

.gemini-live-audio-widget .stop-conversation-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.gemini-live-audio-widget .conversation-mode {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.gemini-live-audio-widget .conversation-mode label {
    margin-top: 5px;
    display: inline-block;
}

.gemini-live-audio-widget .messages {
    height: 200px;
    overflow-y: auto;
    padding: 15px;
    background: white;
}

.gemini-live-audio-widget .message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
}

.gemini-live-audio-widget .message.user {
    background: #e3f2fd;
    text-align: right;
}

.gemini-live-audio-widget .message.ai {
    background: #f3e5f5;
}

.gemini-live-audio-widget .message.system {
    background: #fff3e0;
}

/* ==========================================================================
   Triangle Voice Interface Styles
   ========================================================================== */

.gemini-voice-triangle-widget {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: none !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.gemini-voice-triangle-widget * {
    box-sizing: border-box !important;
}

/* Force full viewport coverage */
html.triangle-active,
body.triangle-active {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

/* Hide any page containers that might constrain width */
body.triangle-active .site-content,
body.triangle-active .container,
body.triangle-active .content-area,
body.triangle-active .main,
body.triangle-active #main,
body.triangle-active #content,
body.triangle-active .entry-content {
    overflow: visible !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.triangle-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.triangle-container:hover {
    transform: scale(1.05);
}

.triangle-container.recording {
    animation: recordingPulse 1s ease-in-out infinite;
}

.triangle-container.speaking .triangle-svg {
    animation: speakingRotate 2s linear infinite;
}

/* Keep logo completely static - separate from triangle container */
.static-logo {
    animation: none !important;
    transform: translate(-50%, -50%) !important;
    position: absolute !important;
    z-index: 999999 !important;
}

/* Ensure no rotation is applied to logo */
.static-logo,
.static-logo * {
    animation: none !important;
    transform-origin: center !important;
}

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

@keyframes speakingRotate {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.05); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes pulseRing {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.pulse-ring.active {
    animation: pulseRing 1.5s ease-out infinite;
}

.triangle-shape {
    transition: fill 0.2s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.4);
}

/* ==========================================================================
   Admin Interface Styles
   ========================================================================== */

.tab-content {
    display: none;
}

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

.conversation-item {
    background: #f9f9f9;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.conversation-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.user-message {
    background: #e3f2fd;
    padding: 8px;
    border-radius: 4px;
    margin: 5px 0;
}

.ai-response {
    background: #f3e5f5;
    padding: 8px;
    border-radius: 4px;
    margin: 5px 0;
}

/* ==========================================================================
   Test Shortcode Styles
   ========================================================================== */

.gemini-test-widget {
    background: #f0f8ff;
    border: 2px solid #0073aa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.gemini-test-widget h3 {
    color: #0073aa;
    margin-top: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .gemini-live-audio-widget .controls {
        padding: 15px;
    }
    
    .gemini-live-audio-widget .start-conversation-btn,
    .gemini-live-audio-widget .stop-conversation-btn {
        padding: 12px 24px;
        font-size: 14px;
        margin: 8px;
    }
    
    .gemini-live-audio-widget .messages {
        height: 150px;
        padding: 10px;
    }
    
    .triangle-container {
        transform: scale(0.8);
    }
    
    .triangle-container:hover {
        transform: scale(0.85);
    }
}

@media (max-width: 480px) {
    .gemini-live-audio-widget .conversation-mode {
        font-size: 12px;
    }
    
    .gemini-live-audio-widget .conversation-mode label {
        display: block;
        margin: 8px 0;
    }
}
