/* Harbor — Voice AI Assistant Styles */

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ========== Main Layout ========== */
.main-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ========== Title & Status ========== */
.name {
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #667eea, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 24px;
}

.status {
    color: #888;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: 8px;
    transition: color 0.3s ease;
}

/* ========== Waveform ========== */
.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 300px;
    height: 200px;
}

.wave-bar {
    width: 6px;
    height: 60px;
    background: linear-gradient(to top, #667eea, #764ba2, #f7931e);
    border-radius: 3px;
    transform-origin: center;
    transition: height 0.1s ease;
}

@keyframes wave {
    0%, 100% { height: 30px; opacity: 0.6; }
    25% { height: 80px; opacity: 1; }
    50% { height: 120px; opacity: 1; }
    75% { height: 60px; opacity: 0.8; }
}

.wave-bar:nth-child(1)  { animation: wave 1.2s ease-in-out infinite; }
.wave-bar:nth-child(2)  { animation: wave 1.2s ease-in-out 0.1s infinite; }
.wave-bar:nth-child(3)  { animation: wave 1.2s ease-in-out 0.2s infinite; }
.wave-bar:nth-child(4)  { animation: wave 1.2s ease-in-out 0.3s infinite; }
.wave-bar:nth-child(5)  { animation: wave 1.2s ease-in-out 0.4s infinite; }
.wave-bar:nth-child(6)  { animation: wave 1.2s ease-in-out 0.5s infinite; }
.wave-bar:nth-child(7)  { animation: wave 1.2s ease-in-out 0.6s infinite; }
.wave-bar:nth-child(8)  { animation: wave 1.2s ease-in-out 0.7s infinite; }
.wave-bar:nth-child(9)  { animation: wave 1.2s ease-in-out 0.8s infinite; }
.wave-bar:nth-child(10) { animation: wave 1.2s ease-in-out 0.9s infinite; }
.wave-bar:nth-child(11) { animation: wave 1.2s ease-in-out 1.0s infinite; }
.wave-bar:nth-child(12) { animation: wave 1.2s ease-in-out 1.1s infinite; }
.wave-bar:nth-child(13) { animation: wave 1.2s ease-in-out 1.2s infinite; }
.wave-bar:nth-child(14) { animation: wave 1.2s ease-in-out 1.3s infinite; }
.wave-bar:nth-child(15) { animation: wave 1.2s ease-in-out 1.4s infinite; }

/* Speaking state — faster animation */
.wave-container.speaking .wave-bar {
    animation-duration: 0.3s;
}
.wave-container.speaking .wave-bar:nth-child(odd) {
    animation-direction: reverse;
}

/* Recording state — pulsing glow */
.wave-container.recording .wave-bar {
    animation-duration: 0.6s;
    background: linear-gradient(to top, #f7931e, #ff6b6b, #f7931e);
}

/* Thinking state — slow and dim */
.wave-container.thinking .wave-bar {
    animation-duration: 2s;
    opacity: 0.4;
}

/* ========== Controls ========== */
.controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
}

.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #333;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4e 100%);
    color: #999;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.mic-btn:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    color: #667eea;
}

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

.mic-btn.recording {
    background: linear-gradient(135deg, #f7931e 0%, #ff6b6b 100%);
    border-color: #f7931e;
    color: #fff;
    animation: pulse-btn 1s ease-in-out infinite;
}

@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 20px rgba(247, 147, 30, 0.4); }
    50% { box-shadow: 0 0 50px rgba(247, 147, 30, 0.7); }
}

.side-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #333;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4e 100%);
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.side-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
    color: #667eea;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f7931e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.hint {
    color: #555;
    font-size: 12px;
    margin-top: 16px;
    letter-spacing: 1px;
}

/* ========== Slide Panels ========== */
.slide-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border-top: 1px solid rgba(102, 126, 234, 0.3);
    max-height: 60vh;
    overflow-y: auto;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.slide-panel.open {
    transform: translateY(0);
}

.slide-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.slide-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ccc;
}

.slide-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: color 0.2s;
}

.slide-panel-close:hover {
    color: #fff;
}

/* ========== Chat Panel ========== */
.transcript-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 40vh;
    padding: 4px 0;
}

.transcript-empty {
    color: #555;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.transcript-bubble {
    max-width: 80%;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    animation: fadeUp 0.3s ease-out;
    word-wrap: break-word;
}

.transcript-bubble.user {
    align-self: flex-end;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #99aaee;
}

.transcript-bubble.ai {
    align-self: flex-start;
    background: rgba(247, 147, 30, 0.12);
    border: 1px solid rgba(247, 147, 30, 0.25);
    color: #ddd;
}

.transcript-bubble.system {
    align-self: center;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #888;
    font-size: 12px;
    text-align: center;
}

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

/* Chat Input */
.chat-input-area {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #667eea;
}

.chat-input::placeholder {
    color: #555;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #5a6fd6;
}

/* ========== Document Panel ========== */
.doc-upload-area {
    margin-bottom: 12px;
}

.upload-btn {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.upload-btn:hover {
    opacity: 0.85;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-empty {
    color: #555;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doc-name {
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
}

.doc-size {
    color: #666;
    font-size: 11px;
}

.doc-remove-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.doc-remove-btn:hover {
    color: #ff6b6b;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========== Auth Pages ========== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-loading {
    color: #888;
    font-size: 16px;
    letter-spacing: 2px;
}

.auth-form {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-title {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #667eea, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.auth-subtitle {
    color: #888;
    font-size: 14px;
    text-align: center;
    letter-spacing: 1px;
}

.auth-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: #667eea;
}

.auth-input::placeholder {
    color: #555;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 1px;
}

.auth-btn:hover {
    opacity: 0.9;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.auth-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    cursor: pointer;
}

.auth-link:hover {
    color: rgba(255, 255, 255, 0.85);
}

.auth-link-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.6rem;
}

.auth-success {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #6ee7b7;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: center;
}

/* ========== Settings Panel ========== */
.settings-panel {
    max-height: 70vh;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 55vh;
    padding-bottom: 16px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.settings-label {
    color: #888;
    font-size: 13px;
}

.settings-value {
    color: #ccc;
    font-size: 13px;
}

.settings-loading {
    color: #555;
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.settings-logout-btn {
    margin-top: 8px;
    padding: 8px 20px;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}

.settings-logout-btn:hover {
    background: rgba(255, 107, 107, 0.25);
}

/* API Key Groups */
.settings-key-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-key-group-title {
    font-size: 13px;
    font-weight: 500;
    color: #999;
    margin-top: 4px;
}

.settings-key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    flex-wrap: wrap;
}

.settings-key-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.settings-key-label {
    color: #aaa;
    font-size: 13px;
    font-weight: 500;
}

.settings-key-value {
    color: #667eea;
    font-size: 12px;
    font-family: monospace;
}

.settings-key-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.settings-key-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    outline: none;
    font-family: monospace;
}

.settings-key-input:focus {
    border-color: #667eea;
}

.settings-key-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.settings-key-verify-btn,
.settings-key-save-btn,
.settings-key-cancel-btn,
.settings-key-edit-btn,
.settings-key-delete-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.settings-key-verify-btn {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.settings-key-verify-btn:hover { background: rgba(102, 126, 234, 0.25); }

.settings-key-save-btn {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.settings-key-save-btn:hover { background: rgba(76, 175, 80, 0.25); }

.settings-key-cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #888;
}

.settings-key-cancel-btn:hover { background: rgba(255, 255, 255, 0.1); }

.settings-key-edit-btn {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.settings-key-edit-btn:hover { background: rgba(102, 126, 234, 0.25); }

.settings-key-delete-btn {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.25);
    color: #ff6b6b;
}

.settings-key-delete-btn:hover { background: rgba(255, 107, 107, 0.2); }

.settings-key-verify-btn:disabled,
.settings-key-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-verify-ok {
    color: #4caf50;
    font-size: 12px;
    font-weight: 500;
}

.settings-verify-fail {
    color: #ff6b6b;
    font-size: 12px;
    font-weight: 500;
}

/* Team Section */
.settings-team-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.settings-team-email {
    color: #ccc;
    font-size: 13px;
}

.settings-team-role {
    color: #888;
    font-size: 12px;
    text-transform: capitalize;
}

.settings-invite-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-invite-title {
    font-size: 13px;
    font-weight: 500;
    color: #999;
}

.settings-invite-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.settings-invite-input:focus {
    border-color: #667eea;
}

select.settings-invite-input {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.settings-invite-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    align-self: flex-start;
}

.settings-invite-btn:hover {
    opacity: 0.9;
}

.settings-invite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
