/* PreMeet MVP Styles */

:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --bg: #F9FAFB;
    --card-bg: #FFFFFF;
    --text: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --user-bubble: #4F46E5;
    --ai-bubble: #F3F4F6;
    --success: #10B981;
    --error: #EF4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--ai-bubble);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Chat UI */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 600px;
    margin: 0 auto;
}

.chat-header {
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.chat-header h1 {
    font-size: 1.1rem;
    color: var(--primary);
}

.chat-header .meeting-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
}

.message.user {
    background: var(--user-bubble);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background: var(--ai-bubble);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.typing {
    background: var(--ai-bubble);
    color: var(--text-muted);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.chat-input-container {
    padding: 16px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.send-btn:hover {
    background: var(--primary-dark);
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Complete state */
.chat-complete {
    text-align: center;
    padding: 20px;
}

.chat-complete h2 {
    color: var(--success);
    margin-bottom: 12px;
}

.chat-complete p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Brief page */
.brief-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

/* Brief toolbar */
.brief-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brief-toolbar .btn-secondary {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.copy-feedback {
    font-size: 0.9rem;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.2s;
}

.copy-feedback.visible {
    opacity: 1;
}

.brief-header {
    text-align: center;
    padding: 20px 0 30px;
}

.brief-header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.brief-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brief-content h1, .brief-content h2, .brief-content h3 {
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
}

.brief-content h1:first-child, .brief-content h2:first-child {
    margin-top: 0;
}

.brief-content h1 { font-size: 1.5rem; }
.brief-content h2 { font-size: 1.25rem; color: var(--primary); }
.brief-content h3 { font-size: 1.1rem; }

.brief-content p {
    margin-bottom: 12px;
}

.brief-content ul, .brief-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.brief-content li {
    margin-bottom: 8px;
}

.brief-content strong {
    color: var(--text);
}

/* Links modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    margin-bottom: 16px;
    color: var(--success);
}

.link-group {
    margin-bottom: 16px;
}

.link-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.link-input-group {
    display: flex;
    gap: 8px;
}

.link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg);
}

.copy-btn {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.modal-footer {
    margin-top: 20px;
    text-align: center;
}

/* Loading spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.error {
    background: #FEF2F2;
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Single-party note */
.single-party-note {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.single-party-note p {
    margin: 0;
}

/* Not ready state */
.not-ready {
    text-align: center;
    padding: 40px 20px;
}

.not-ready h2 {
    color: var(--text);
    margin-bottom: 12px;
}

.not-ready p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Modern Input Bar */
.input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-actions-left,
.input-actions-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.input-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.input-icon-btn:hover {
    background: var(--ai-bubble);
    color: var(--primary);
}

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

.input-icon-btn.send-btn {
    background: var(--primary);
    color: white;
}

.input-icon-btn.send-btn:hover {
    background: var(--primary-dark);
    color: white;
}

.input-icon-btn.send-btn:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-form {
    flex: 1;
    display: flex;
}

.input-form .chat-input {
    border: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 1rem;
}

.input-form .chat-input:focus {
    outline: none;
    box-shadow: none;
}

/* Voice Overlay */
.voice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.voice-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    color: white;
}

.voice-visualizer {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 60px;
}

.visualizer-bar {
    width: 6px;
    height: 20px;
    background: var(--primary);
    border-radius: 3px;
    animation: visualize 0.8s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) { animation-delay: 0s; }
.visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; }
.visualizer-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes visualize {
    0%, 100% { height: 20px; }
    50% { height: 50px; }
}

.voice-status {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.voice-status.error {
    color: var(--error);
}

.stop-voice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--error);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.stop-voice-btn:hover {
    background: #dc2626;
    transform: scale(1.02);
}

/* Transcribing indicator */
.transcribing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.transcribing-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Remove duplicate - see line 236 for main definition */

/* Upload status */
.upload-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px 12px;
    text-align: center;
    background: var(--ai-bubble);
    border-radius: 8px;
    margin-bottom: 8px;
}

.upload-status.error {
    color: var(--error);
    background: #FEF2F2;
}

/* Polling and update notifications */
.polling-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.update-notification {
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

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