/* Kuapa AI - Voice-Enabled Interface Styles */

:root {
    --primary-color: #00ff88;
    --primary-dark: #00cc6d;
    --secondary-color: #6c5ce7;
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-light: #252540;
    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --error: #ff6b6b;
    --success: #51cf66;
    --warning: #ffd43b;
    --border: #2d2d44;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--surface), var(--surface-light));
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px var(--shadow);
}

header h1 {
    font-size: 2.5em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 20px;
}

.status-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.connecting {
    background: var(--warning);
}

.status-dot.connected {
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--error);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.language-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

#language-label {
    color: var(--text-secondary);
}

#detected-language {
    color: var(--primary-color);
    font-weight: 600;
}

/* Voice Controls */
.voice-controls {
    background: var(--surface);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px var(--shadow);
}

.voice-button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 60px;
    padding: 20px 40px;
    color: var(--background);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.voice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.voice-button:active {
    transform: translateY(0);
}

.voice-button.recording {
    background: linear-gradient(135deg, var(--error), #ff4444);
    animation: recording-pulse 1.5s ease-in-out infinite;
}

@keyframes recording-pulse {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(255, 107, 107, 0.6);
    }
}

.voice-button svg {
    width: 32px;
    height: 32px;
}

.voice-visualizer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

#waveform {
    border-radius: 10px;
    background: #0a0a15;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.recording-indicator {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pulse-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--error);
    animation: pulse-ring 1.5s ease-out infinite;
    position: relative;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

#recording-time {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* Chat Container */
.chat-container {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px var(--shadow);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 20px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--surface-light);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Messages */
.message {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--secondary-color), #5f4dd1);
    margin-left: auto;
    border-radius: 20px 20px 5px 20px;
}

.message.assistant .message-content {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 20px 20px 20px 5px;
}

.message.system .message-content {
    background: rgba(255, 212, 59, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
    text-align: center;
    border-radius: 10px;
    font-size: 0.9em;
}

.message-content {
    max-width: 80%;
    padding: 15px 20px;
    word-wrap: break-word;
}

.message.user .message-content {
    margin-left: auto;
}

.message-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8em;
    color: var(--text-secondary);
}

.voice-tag {
    background: var(--primary-color);
    color: var(--background);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
}

.timing-info {
    color: var(--primary-color);
    cursor: help;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 10px;
    background: var(--surface-light);
    padding: 10px;
    border-radius: 30px;
    border: 2px solid var(--border);
    transition: border-color 0.3s ease;
}

.chat-input-container:focus-within {
    border-color: var(--primary-color);
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1em;
    padding: 10px 15px;
    resize: none;
    max-height: 120px;
}

#message-input::placeholder {
    color: var(--text-secondary);
}

#send-button {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#send-button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

#send-button:active {
    transform: scale(0.95);
}

#send-button svg {
    fill: var(--background);
}

/* Settings Panel */
.settings-panel {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px var(--shadow);
}

.settings-toggle {
    background: var(--surface-light);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    width: 100%;
}

.settings-toggle:hover {
    border-color: var(--primary-color);
    background: var(--surface);
}

.settings-content {
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

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

.settings-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    color: var(--text-primary);
    font-size: 0.95em;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.setting-item select {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
}

/* Suggestions */
.suggestions {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px var(--shadow);
}

.suggestions p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95em;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.suggestion-btn {
    background: var(--surface-light);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9em;
    text-align: left;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.primary-btn,
.secondary-btn {
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    margin: 10px 5px;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary-color);
    color: var(--background);
    border: none;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.secondary-btn:hover {
    border-color: var(--primary-color);
    background: var(--surface-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .status-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .voice-button {
        max-width: 100%;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .suggestion-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        padding: 30px;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border: #ffffff;
        --surface: #000000;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .voice-controls,
    .chat-input-container,
    .suggestions,
    .settings-panel {
        display: none;
    }
}
