/**
 * Voice Widget Styles
 * 중앙 고정형 음성 상담 위젯
 */

#ai-voice-widget {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.voice-widget-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.3);
    width: 400px;
    max-width: 90vw;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    border: 1px solid #bae6fd;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header */
.voice-widget-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

.voice-widget-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.voice-widget-header .subtitle {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.95;
}

.voice-widget-header .description {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.4;
}

/* Content */
.voice-widget-content {
    padding: 32px 24px;
    text-align: center;
}

/* Voice Button */
.voice-widget-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    position: relative;
}

.voice-widget-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

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

.voice-widget-btn.active {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.5);
}

.voice-widget-btn.pulsing::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 3px solid #22d3ee;
    animation: pulse 1.5s ease-out infinite;
}

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

.voice-widget-btn svg {
    width: 48px;
    height: 48px;
}

/* Status Container */
.status-container {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.voice-widget-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #e0f2fe;
    border-radius: 20px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e0;
}

.status-indicator.connecting {
    background: #0ea5e9;
    animation: blink 1s infinite;
}

.status-indicator.connected {
    background: #06b6d4;
}

.status-indicator.error {
    background: #ef4444;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-text {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

/* Timer Display */
.timer-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #dbeafe;
    border-radius: 20px;
    color: #0369a1;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.timer-display.warning {
    background: #fee2e2;
    color: #dc2626;
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.timer-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.timer-text {
    font-variant-numeric: tabular-nums;
    min-width: 45px;
    text-align: center;
}

/* Conversation Log */
.conversation-log {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
}

.log-header {
    font-weight: 600;
    font-size: 14px;
    color: #0369a1;
    margin-bottom: 12px;
    text-align: center;
}

.conversation-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 12px;
    border-radius: 12px;
    background: #f0f9ff;
}

.message.user {
    background: #e0f2fe;
    margin-left: auto;
    max-width: 80%;
}

.message.ai {
    background: #cffafe;
    margin-right: auto;
    max-width: 80%;
}

.message.system {
    background: #e0f2fe;
    text-align: center;
    font-size: 12px;
    font-style: italic;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
}

.speaker {
    font-weight: 600;
    color: #0369a1;
}

.time {
    color: #9ca3af;
}

.message-content {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
}

/* Footer */
.voice-widget-footer {
    padding: 16px 24px;
    background: #f0f9ff;
    text-align: center;
    color: #0891b2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-widget-footer small {
    font-size: 12px;
}

.usage-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.usage-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    background: #bae6fd;
    color: #0369a1;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    min-width: 45px;
}

.usage-count.limit-reached {
    background: #fecaca;
    color: #dc2626;
}

.powered-by {
    opacity: 0.7;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 4px;
}

.contact-link:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0891b2 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.contact-link:active {
    transform: translateY(0);
}

/* Scrollbar Styling */
.conversation-log::-webkit-scrollbar {
    width: 6px;
}

.conversation-log::-webkit-scrollbar-track {
    background: #e0f2fe;
    border-radius: 10px;
}

.conversation-log::-webkit-scrollbar-thumb {
    background: #7dd3fc;
    border-radius: 10px;
}

.conversation-log::-webkit-scrollbar-thumb:hover {
    background: #0ea5e9;
}

/* Responsive Design */
@media (max-width: 480px) {
    .voice-widget-container {
        width: 90vw;
    }

    .voice-widget-btn {
        width: 100px;
        height: 100px;
    }

    .voice-widget-btn svg {
        width: 40px;
        height: 40px;
    }

    .voice-widget-header h2 {
        font-size: 20px;
    }

    .conversation-log {
        max-height: 200px;
    }
}
