/* Harmony Platform - Rebrand */
/* Huisstijl kleuren: Dark Navy + Neon Cyan */

:root {
    --primary-color: #00FFFF;
    /* Neon Cyan */
    --primary-dark: #00CCCC;
    /* Darker Cyan for hover states */
    --accent-color: #E8A435;
    /* Keep gold accent for now or change to secondary cyan */
    --tile-green: #008B8B;
    /* Dark Cyan/Teal for secondary gradients */
    --text-dark: #FFFFFF;
    /* White text for dark mode */
    --text-muted: #CCCCCC;
    /* Muted text */
    --bg-dark: #050A14;
    /* Dark Navy Background */
    --card-bg: rgba(20, 30, 50, 0.7);
    /* Glassmorphism background */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #050A14;
    /* Solid Dark Navy */
    background-image: radial-gradient(circle at 50% 0%, #1a2a40 0%, #050A14 100%);
    /* Subtle gradient */
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Popup mode - smaller container */
body.popup-mode {
    background: transparent;
}

body.popup-mode .container {
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-dark);
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 95%;
}

.logo {
    width: auto;
    height: auto;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.logo-img {
    width: 100%;
    height: auto;
}

h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 50px;
    margin-bottom: 24px;
    font-weight: 500;
}

.status.idle {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.status.connecting {
    background: rgba(255, 165, 0, 0.1);
    color: #FFB74D;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.status.active {
    background: rgba(0, 255, 255, 0.2);
    color: #E0FFFF;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.status.error {
    background: rgba(255, 0, 0, 0.1);
    color: #FF8A80;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
}

.status.active .status-dot {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.call-button {
    width: 100%;
    padding: 20px 32px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--tile-green) 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.call-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27, 123, 110, 0.4);
}

.call-button.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #D4922E 100%);
}

.call-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.listening-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    height: 40px;
}

.listening-indicator.hidden {
    visibility: hidden;
}

.wave {
    width: 6px;
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    animation: wave 1s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.1s;
}

.wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1);
    }
}

footer {
    margin-top: 32px;
    color: #999;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 32px 24px;
    }

    h1 {
        font-size: 24px;
    }

    .call-button {
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 12px;
}

.mode-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Chat Section */
#chat-section {
    width: 100%;
}

.chat-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-messages {
    height: 280px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message .message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.chat-message.bot .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.user .message-content {
    background: var(--primary-color);
    color: var(--bg-dark);
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.chat-message.loading .message-content {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.chat-message.loading .dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out both;
}

.chat-message.loading .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-message.loading .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes pulse {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-input-container {
    display: flex;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--bg-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.send-button:hover {
    background: var(--primary-dark);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}


.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 100;
}

.logout-btn:hover {
    opacity: 1;
}

/* Login Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #1a2a40 0%, #050A14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.login-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.1);
}

.login-btn {
    width: 100%;
    margin-top: 12px;
    font-size: 16px;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #ffcdd2;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Message Sources */
.message-sources {
    margin-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 8px;
    font-size: 0.85em;
    color: #666;
}

.chat-message.bot .message-sources {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.chat-message.user .message-sources {
    border-top-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 20, 40, 0.7);
}

.source-item {
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}