/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden; /* Prevent body scrolling */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: linear-gradient(135deg, #fefefe 0%, #f4f4f4 50%, #f9f9f9 100%);
    background-attachment: fixed;
    color: #1e293b;
    line-height: 1.6;
    font-size: 14px;
    font-weight: 400;
}

/* App Container - Full viewport height */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fixed Header */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    color: #1e293b;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Microphone Selector */
.mic-selector-container {
    position: relative;
    display: flex;
    align-items: center;
}

.mic-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(248, 250, 252, 0.9);
    color: #475569;
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 120px;
    justify-content: space-between;
}

.mic-selector-btn:hover {
    background: rgba(226, 232, 240, 0.95);
    border-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-1px);
}

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

.mic-selector-text {
    flex: 1;
    text-align: left;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mic-selector-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.mic-selector-btn[aria-expanded="true"] .mic-selector-arrow {
    transform: rotate(180deg);
}

.mic-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 240px;
    max-height: 280px;
    overflow: hidden;
}

.mic-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.8);
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.mic-list {
    max-height: 200px;
    overflow-y: auto;
}

.mic-loading {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.mic-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
}

.mic-option:hover {
    background: rgba(249, 115, 22, 0.08);
}

.mic-option.selected {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
    font-weight: 500;
}

.mic-option-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mic-option-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mic-option-default {
    font-size: 0.75rem;
    color: #6b7280;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: auto;
}


/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dropdown-btn:hover {
    background: rgba(226, 232, 240, 0.95);
    border-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
}

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

.dropdown-btn[aria-expanded="true"] {
    border-color: rgba(249, 115, 22, 0.6);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.dropdown-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.dropdown-text {
    flex: 1;
    text-align: left;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    color: #6b7280;
}

.dropdown-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6b7280;
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: sticky;
    top: 0;
}

.dropdown-divider {
    height: 1px;
    background: rgba(226, 232, 240, 0.6);
    margin: 0.25rem 0;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    color: #374151;
}

.dropdown-option:hover {
    background: rgba(249, 115, 22, 0.08);
    color: #9a3412;
}

.dropdown-option.selected {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
    font-weight: 500;
}

.dropdown-option.selected:hover {
    background: rgba(249, 115, 22, 0.16);
}

.option-text {
    flex: 1;
    text-align: left;
}

/* Microphone dropdown specific styles */
.mic-dropdown-container .dropdown-option .mic-icon {
    color: #6b7280;
    flex-shrink: 0;
}

.mic-dropdown-container .dropdown-option:hover .mic-icon {
    color: #ea580c;
}

.mic-dropdown-container .dropdown-option.selected .mic-icon {
    color: #ea580c;
}

.mic-default {
    font-size: 0.75rem;
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: auto;
    font-weight: 500;
}

/* Microphone permission message */
.mic-permission-message {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

.mic-permission-message p {
    margin: 0.5rem 0;
}

.mic-permission-message p:first-child {
    font-weight: 500;
    color: #374151;
}

/* Microphone Permission Section */
.mic-permission-section {
    margin-bottom: 1.5rem;
}

.mic-permission-state {
    padding: 2rem;
    text-align: center;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    margin-bottom: 1rem;
}

.mic-permission-state.hidden {
    display: none;
}

.permission-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
}

.permission-icon.warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

.permission-icon.error {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

.permission-icon.success {
    background: #dcfce7;
    border-color: #22c55e;
    color: #16a34a;
}

.permission-loading-icon {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.mic-permission-state h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.mic-permission-state p {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.permission-success-text {
    color: #16a34a !important;
    font-weight: 500;
    margin-bottom: 0 !important;
    text-align: center !important;
}

/* Permission Buttons */
.permission-enable-btn,
.permission-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.permission-enable-btn:hover,
.permission-retry-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.permission-enable-btn:active,
.permission-retry-btn:active {
    transform: translateY(0);
}

.permission-retry-btn {
    background: #6b7280;
}

.permission-retry-btn:hover {
    background: #4b5563;
}

/* Permission Instructions */
.permission-instructions {
    text-align: left;
    max-width: 350px;
    margin: 1.5rem auto;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.instruction-step:last-child {
    margin-bottom: 0;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.instruction-step span:last-child {
    color: #374151;
}

/* Responsive adjustments for microphone permissions */
@media (max-width: 768px) {
    .mic-permission-state {
        padding: 1.5rem 1rem;
    }
    
    .permission-icon {
        width: 50px;
        height: 50px;
    }
    
    .permission-instructions {
        max-width: 100%;
    }
}

/* Language Selection Interface */
.language-selector {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.language-header {
    text-align: center;
    margin-bottom: 2rem;
}

.language-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.language-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.popular-languages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(248, 250, 252, 0.8);
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    text-align: left;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.language-option:hover {
    background: rgba(226, 232, 240, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.language-option.selected {
    background: rgba(249, 115, 22, 0.1);
    border-color: #f97316;
    color: #9a3412;
}

.language-option.selected:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: #ea580c;
}

.language-flag {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.language-name {
    font-weight: 500;
    color: #374151;
    flex-grow: 1;
}

.language-option.selected .language-name {
    color: #9a3412;
}

.language-code {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: rgba(156, 163, 175, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.language-option.selected .language-code {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.more-languages-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(248, 250, 252, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: #475569;
    margin: 0 auto;
}

.show-more-btn:hover {
    background: rgba(226, 232, 240, 0.8);
    transform: translateY(-1px);
}

.expand-icon {
    transition: transform 0.3s ease;
}

.show-more-btn.expanded .expand-icon {
    transform: rotate(180deg);
}

.additional-languages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.additional-languages.hidden {
    max-height: 0;
    opacity: 0;
}

.additional-languages:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
}

.answer-content.hidden {
    display: none;
}

/* Microphone Selection Interface */
.mic-selection-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.mic-selection-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.mic-selection-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.mic-selection-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.mic-radio-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto; /* Allow scrolling if many mics */
}

.mic-loading {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.mic-radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(248, 250, 252, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.mic-radio-option:hover {
    background: rgba(226, 232, 240, 0.8);
    border-color: rgba(148, 163, 184, 0.8);
}

.mic-radio-option.selected {
    background: rgba(249, 115, 22, 0.1);
    border-color: #f97316;
}

.mic-radio-option.selected:hover {
    background: rgba(249, 115, 22, 0.15);
}

.mic-radio-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #f97316;
}

.mic-radio-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.mic-radio-icon {
    width: 16px;
    height: 16px;
    color: #475569;
    flex-shrink: 0;
}

.mic-radio-option.selected .mic-radio-icon {
    color: #f97316;
}

.mic-radio-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
    flex: 1;
    cursor: pointer;
}

.mic-radio-option.selected .mic-radio-label {
    color: #9a3412;
}

.mic-radio-default {
    font-size: 0.75rem;
    color: #059669;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Authentication UI */
.auth-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: #ea580c;
    transform: translateY(-1px);
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.user-plan {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: capitalize;
}

.user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    min-width: 150px;
    z-index: 1000;
}

.user-profile:hover .user-menu {
    display: block;
}

.user-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.user-menu button:hover {
    background: #f1f5f9;
}

.upgrade-btn {
    color: #f97316;
    font-weight: 500;
}

.manage-btn {
    color: #64748b;
}

.logout-btn {
    color: #dc2626;
}

/* Usage Info Card - Elegant design within language selector */
.usage-info-card {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 248, 235, 0.8);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* .usage-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
} */

.usage-info-card .usage-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.usage-info-card .usage-icon {
    font-size: 1.25rem;
}

.usage-info-card .usage-title {
    font-size: 1rem;
    font-weight: 600;
    color: #92400e;
    margin: 0;
}

.usage-info-card .sessions-left {
    color: #451a03;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: block;
}

.usage-info-card .upgrade-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.usage-info-card .upgrade-link:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.usage-info-card .upgrade-link:active {
    transform: translateY(0);
}

.usage-info-card .upgrade-text {
    font-size: 1rem;
    color: #78716c;
    margin-top: 0.5rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .usage-info-card {
        margin-top: 2rem;
        padding: 1.25rem;
    }
    
    .usage-info-card .usage-title {
        font-size: 1rem;
    }
    
    .usage-info-card .sessions-left {
        font-size: 1rem;
    }
    
    .usage-info-card .upgrade-link {
        font-size: 1rem;
        padding: 0.4375rem 0.875rem;
    }
}

@media (max-width: 480px) {
    .usage-info-card {
        margin-top: 1rem;
        padding: 1rem;
    }
    
    .usage-info-card .usage-icon {
        font-size: 1.125rem;
    }
    
    .usage-info-card .usage-title {
        font-size: 0.75rem;
    }
    
    .usage-info-card .sessions-left {
        font-size: 0.75rem;
        margin-bottom: 0.625rem;
    }
    
    .usage-info-card .upgrade-link {
        font-size: 0.6875rem;
        padding: 0.375rem 0.75rem;
        gap: 0.25rem;
    }
    
    .usage-info-card .upgrade-text {
        font-size: 0.6875rem;
        margin-top: 0.375rem;
    }
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
}

/* Status indicator in transcript card */
.transcript-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #475569;
    z-index: 1;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Status: Ready/Authenticated - Green (positive) */
.status-ready,
.status-authenticated,
.transcript-status.status-ready,
.transcript-status.status-authenticated {
    color: #059669;
    background: rgba(34, 197, 94, 0.15);
}

/* Status: Connected/Recording - Orange (active) */
.status-connected,
.transcript-status.status-connected {
    color: #ea580c;
    background: rgba(249, 115, 22, 0.15);
}

/* Status: Connecting - Purple (in progress) */
.status-connecting,
.transcript-status.status-connecting {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.15);
}

/* Status: Disconnected - Orange (warning) */
.status-disconnected,
.transcript-status.status-disconnected {
    color: #d97706;
    background: rgba(251, 191, 36, 0.15);
}

/* Status: Error - Red (danger) */
.status-error,
.transcript-status.status-error {
    color: #dc2626;
    background: rgba(248, 113, 113, 0.15);
}

/* Status: Unauthenticated - Gray (neutral) */
.status-unauthenticated,
.transcript-status.status-unauthenticated {
    color: #6b7280;
    background: rgba(156, 163, 175, 0.15);
}

/* Status: Limited - Yellow (caution) */
.status-limited,
.transcript-status.status-limited {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

/* Status indicator icon styling */
.transcript-status .status-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.transcript-status .phone-icon {
    color: currentColor;
    transition: transform 0.2s ease;
}

/* Timer text styling */
.transcript-status .timer {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Clickable status during recording - override connected status to be red like real phone */
.transcript-status.clickable-status {
    cursor: pointer;
    user-select: none;
    color: #b91c1c !important;
    background: rgba(185, 28, 28, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Override the blue status dot to be red */
.transcript-status.clickable-status::before {
    background-color: #b91c1c !important;
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.7) !important;
}

.transcript-status.clickable-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(185, 28, 28, 0.4);
    background: rgba(185, 28, 28, 0.3) !important;
    color: #991b1b !important;
}

.transcript-status.clickable-status:hover .phone-icon {
    transform: rotate(-15deg);
}

.transcript-status.clickable-status:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px -2px rgba(185, 28, 28, 0.4);
    background: rgba(185, 28, 28, 0.35) !important;
}

/* Clear Confirmation Modal */
.clear-modal-content {
    max-width: 480px;
    padding: 2rem;
}

.clear-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.clear-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.clear-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.clear-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.clear-warning {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.clear-actions {
    display: flex;
    gap: 0.5rem;
}

.clear-modal-content .clear-actions .clear-btn {
    flex: 1;
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 8px !important;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-modal-content .clear-actions .clear-btn:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.clear-modal-content .clear-actions .clear-btn:active {
    transform: translateY(0);
}

.clear-modal-content .clear-actions .cancel-btn {
    flex: 1;
    background: #1f2937 !important;
    color: white !important;
    border: 1px solid #374151 !important;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-modal-content .clear-actions .cancel-btn:hover {
    background: #111827 !important;
    border-color: #4b5563 !important;
}

/* Mobile optimizations for clear modal */
@media (max-width: 640px) {
    .clear-modal-content {
        max-width: 95vw;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .clear-header h2 {
        font-size: 1.25rem;
    }
    
    .clear-subtitle {
        font-size: 0.875rem;
    }
    
    .warning-content {
        gap: 0.5rem;
    }
    
    .clear-actions {
        gap: 0.5rem;
    }
}

/* Exit Confirmation Modal */
.exit-modal-content {
    max-width: 480px;
    padding: 2rem;
}

.exit-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.exit-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.exit-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.exit-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.exit-warning {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.warning-content {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.warning-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.warning-text strong {
    color: #dc2626;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.warning-text p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.exit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #059669;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.download-btn:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

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

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.exit-btn {
    flex: 1;
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exit-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

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

.cancel-btn {
    flex: 1;
    background: rgba(71, 85, 105, 0.1);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.2);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: rgba(71, 85, 105, 0.15);
    border-color: rgba(71, 85, 105, 0.3);
    /* transform: translateY(-1px); */
}

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

/* Mobile optimizations for exit modal */
@media (max-width: 640px) {
    .exit-modal-content {
        max-width: 95vw;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .exit-header h2 {
        font-size: 1.25rem;
    }
    
    .exit-subtitle {
        font-size: 0.875rem;
    }
    
    .warning-content {
        gap: 0.5rem;
    }
    
    .warning-icon {
        font-size: 1.125rem;
    }
    
    .warning-text {
        font-size: 0.8rem;
    }
    
    .download-btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .exit-btn, .cancel-btn {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Main Content Area - Takes remaining space */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Allow flex children to shrink */
    position: relative; /* For floating buttons */
}

/* Answer Section - 3/4 of main area */
.answer-section {
    flex: 3;
    /* background: rgba(255, 255, 255, 0.8); */
    /* backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); */
    margin: 0;
    border: none;
    border-radius: 0;
    /* border-radius: 24px; */
    /* border: 1px solid rgba(226, 232, 240, 0.6); */
    /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    /* transition: all 0.3s ease; */
    position: relative;
    padding-bottom: 0px; /* Make room for the toolbar */
}


.section-header {
    background: rgba(248, 250, 252, 0.6);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.025em;
}

.generate-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.generate-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.answer-scroll-area {
    flex: 1;
    padding: 1.5rem 1.5rem 4rem 1.5rem;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.7;
    height: calc(100% - 110px); /* Adjust height to account for toolbar */
    /* padding-bottom: 110px; Ensure content doesn't overlap toolbar */
}

.answer-scroll-area p {
    margin: 0 0 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #475569;
}

.answer-scroll-area .placeholder {
    color: #94a3b8;
    text-align: center;
    font-style: italic;
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

/* Removed complex generating state indicators */

/* Markdown content styling */
.markdown-content {
    line-height: 1.8;
    font-size: 0.95rem;
    color: #334155;
    padding: 0.5rem 0;
    max-width: none;
    text-align: left;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin: 2rem 0 1rem 0;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
    position: relative;
}

.markdown-content h1 {
    font-size: 1.5rem;
    border-bottom: 3px solid #f97316;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.markdown-content h2 {
    font-size: 1.25rem;
    position: relative;
    padding-left: 1rem;
}

.markdown-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.125rem;
    bottom: 0.125rem;
    width: 4px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 2px;
}

.markdown-content h3 {
    font-size: 1.125rem;
    color: #475569;
    position: relative;
    padding-left: 0.75rem;
}

.markdown-content h3::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #f97316;
    font-weight: bold;
}

.markdown-content p {
    margin: 1.25rem 0;
    color: #475569;
    line-height: 1.8;
    text-align: left;
    hyphens: none;
}

.markdown-content p:first-of-type {
    margin-top: 0;
}

.markdown-content p:last-of-type {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1.5rem 0;
    padding-left: 0;
    position: relative;
}

.markdown-content ul {
    list-style: none;
}

.markdown-content ul li {
    position: relative;
    padding-left: 1.75rem;
    margin: 0.75rem 0;
}

.markdown-content ul li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: #f97316;
    font-weight: bold;
    font-size: 1.2em;
}

.markdown-content ol {
    counter-reset: list-counter;
    padding-left: 0;
}

.markdown-content ol li {
    position: relative;
    padding-left: 2rem;
    margin: 0.75rem 0;
    counter-increment: list-counter;
}

.markdown-content ol li::before {
    content: counter(list-counter) '.';
    position: absolute;
    left: 0;
    top: 0;
    color: #f97316;
    font-weight: 700;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.markdown-content li {
    color: #475569;
    line-height: 1.7;
    text-align: left;
    hyphens: none;
}

.markdown-content code {
    background: #f6f8fa;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    color: #d1242f;
    border: 1px solid #d1d9e0;
    font-weight: 500;
    letter-spacing: 0.025em;
}


.markdown-content pre {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Language title bar */
.markdown-content pre::before {
    content: attr(data-language);
    display: flex;
    align-items: center;
    background: #f8fafc;
    color: #64748b;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

/* Copy button */
.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s ease;
    z-index: 10;
}

.code-copy-btn::before {
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184' /%3e%3c/svg%3e") no-repeat;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184' /%3e%3c/svg%3e") no-repeat;
    -webkit-mask-size: contain;
}

.code-copy-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.code-copy-btn:active {
    background: #f3f4f6;
}

.code-copy-btn.copied {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
}

.code-copy-btn.copied::before {
    mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5' /%3e%3c/svg%3e") no-repeat;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5' /%3e%3c/svg%3e") no-repeat;
    -webkit-mask-size: contain;
}

/* Code content area */
.markdown-content pre code {
    display: block;
    padding: 1.25rem 1rem;
    overflow-x: auto;
    background: none;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #1e293b;
    white-space: pre;
    tab-size: 2;
}



/* VSCode Light Theme Syntax Highlighting */
.markdown-content pre .hljs-keyword,
.markdown-content pre .hljs-built_in {
    color: #0000ff;
    font-weight: normal;
}

.markdown-content pre .hljs-string {
    color: #a31515;
}

.markdown-content pre .hljs-comment {
    color: #008000;
    font-style: italic;
}

.markdown-content pre .hljs-number,
.markdown-content pre .hljs-literal {
    color: #098658;
}

.markdown-content pre .hljs-title.function,
.markdown-content pre .hljs-title.class,
.markdown-content pre .hljs-title {
    color: #795e26;
}

.markdown-content pre .hljs-variable,
.markdown-content pre .hljs-name {
    color: #001080;
}

.markdown-content pre .hljs-type {
    color: #267f99;
}

.markdown-content pre .hljs-operator,
.markdown-content pre .hljs-punctuation {
    color: #000000;
}

.markdown-content pre .hljs-tag {
    color: #800000;
}

.markdown-content pre .hljs-attribute,
.markdown-content pre .hljs-attr {
    color: #ff0000;
}

.markdown-content pre .hljs-doctag,
.markdown-content pre .hljs-meta {
    color: #0000ff;
}

.markdown-content pre .hljs-params {
    color: #001080;
}

.markdown-content pre .hljs-section {
    color: #0000ff;
    font-weight: bold;
}

.markdown-content blockquote {
    border-left: 4px solid #f97316;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(234, 88, 12, 0.05) 100%);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
    position: relative;
    color: #9a3412;
    font-style: italic;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.1);
    text-align: left;
    hyphens: none;
}

.markdown-content blockquote::before {
    content: '“';
    position: absolute;
    top: -0.25rem;
    left: 1rem;
    font-size: 3rem;
    color: rgba(249, 115, 22, 0.3);
    font-family: Georgia, serif;
    line-height: 1;
}

.markdown-content blockquote p {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.markdown-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
}

.markdown-content th,
.markdown-content td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.markdown-content th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 700;
    color: #334155;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid #f97316;
}

.markdown-content td {
    color: #475569;
    font-size: 0.9rem;
}

.markdown-content tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.5);
}

.markdown-content tr:hover td {
    background: rgba(249, 115, 22, 0.05);
}

/* Math formula styling */
.MathJax {
    font-size: 1rem !important;
    color: #ea580c !important;
}

/* Enhanced markdown elements */
.markdown-content strong {
    color: #f97316;
    font-weight: 700;
}

.markdown-content em {
    color: #475569;
    font-style: italic;
    position: relative;
}

.markdown-content em::before,
.markdown-content em::after {
    content: '';
    position: absolute;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #f97316 50%, transparent 100%);
    width: 100%;
    left: 0;
}

.markdown-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #f97316 50%, transparent 100%);
    margin: 2.5rem 0;
    border-radius: 1px;
}

/* Special content blocks */
.markdown-content .highlight {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.markdown-content .highlight::before {
    content: '⚡';
    position: absolute;
    top: 1rem;
    left: -0.5rem;
    background: #f59e0b;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Enhanced streaming text indicators */
.streaming-cursor::after {
    content: '▊';
    color: #f97316;
    animation: blink 1s infinite;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

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

/* Answer separator styling */
.answer-separator {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 2px solid #e2e8f0;
    position: relative;
    background: linear-gradient(90deg, transparent 0%, rgba(249, 115, 22, 0.1) 50%, transparent 100%);
}

.answer-separator::after {
    content: "New Response";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Enhanced waiting for response indicator */
.waiting-response {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    position: relative;
}

.waiting-response::before {
    content: "Answering";
    margin-right: 12px;
}

.waiting-response::after {
    content: '';
    display: inline-block;
    position: relative;
    width: 40px;
    height: 10px;
    background: 
        radial-gradient(circle, #f97316 2px, transparent 2px),
        radial-gradient(circle, #f97316 2px, transparent 2px),
        radial-gradient(circle, #f97316 2px, transparent 2px);
    background-size: 8px 8px;
    background-position: 
        0 center,
        14px center,
        28px center;
    background-repeat: no-repeat;
    animation: waiting-dots-enhanced 1.4s infinite ease-in-out;
}

@keyframes waiting-dots-enhanced {
    0%, 80%, 100% {
        background-image: 
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px),
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px),
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px);
        transform: scale(1);
    }
    20% {
        background-image: 
            radial-gradient(circle, #f97316 2px, transparent 2px),
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px),
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px);
        transform: scale(1.05);
    }
    40% {
        background-image: 
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px),
            radial-gradient(circle, #f97316 2px, transparent 2px),
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px);
        transform: scale(1.05);
    }
    60% {
        background-image: 
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px),
            radial-gradient(circle, rgba(249, 115, 22, 0.3) 2px, transparent 2px),
            radial-gradient(circle, #f97316 2px, transparent 2px);
        transform: scale(1.05);
    }
}

/* Simplified status text */
.status-text {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Transcript Section - 1/4 of main area */
.transcript-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 0.5rem 0.5rem 0.5rem 0.5rem;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    /* transition: all 0.3s ease; */
    position: relative;
}


.transcript-scroll-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-height: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    -webkit-overflow-scrolling: touch;
    color: #334155;
}

.transcript-scroll-area .placeholder {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

/* Speaker bubble styles */
.speaker-bubble {
    margin: 0.75rem 0;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.speaker-bubble.interviewer {
    justify-content: flex-start;
}

.speaker-bubble.interviewee {
    justify-content: flex-end;
}

.bubble-content {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.6;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.interviewer .bubble-content {
    background: rgba(248, 250, 252, 0.9);
    color: #334155;
    border-bottom-left-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.interviewee .bubble-content {
    background: rgba(34, 197, 94, 0.15);
    color: #059669;
    border-bottom-right-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.speaker-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.interviewer .speaker-label {
    color: #64748b;
}

.interviewee .speaker-label {
    color: #059669;
    text-align: right;
}

.partial-text {
    font-style: italic;
    opacity: 0.8;
}

.interviewee .partial-text {
    color: #22c55e;
}

.interviewer .partial-text {
    color: #94a3b8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.status-connected,
.transcript-status.status-connected {
    animation: none;
}

.status-connected::before,
.transcript-status.status-connected::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ea580c;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: recordingPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
}

@keyframes recordingPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(234, 88, 12, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
    }
}

/* Floating buttons CSS removed - functionality moved to toolbar */

/* Header Buttons */
.stop-btn, .clear-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stop-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3), 0 2px 4px -1px rgba(239, 68, 68, 0.06);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stop-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Auto-scroll to bottom button in transcript card */
.transcript-scroll-btn {
    position: absolute;
    bottom: 7rem;
    right: 1rem;
    background: rgba(248, 250, 252, 0.95);
    color: #475569;
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
}

.transcript-scroll-btn:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.transcript-scroll-btn:hover {
    background: rgba(226, 232, 240, 0.95);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-1px);
}

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

/* Mute button in transcript card */
.transcript-mute-btn {
    position: absolute;
    bottom: 3.5rem;
    right: 1rem;
    background: rgba(248, 250, 252, 0.95);
    color: #475569;
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.transcript-mute-btn:hover {
    background: rgba(226, 232, 240, 0.95);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-1px);
}

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

/* Mute button states */
.transcript-mute-btn.muted {
    background: rgba(248, 113, 113, 0.15);
    color: #dc2626;
    border-color: rgba(248, 113, 113, 0.3);
}

.transcript-mute-btn.muted:hover {
    background: rgba(248, 113, 113, 0.25);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.5);
}

.transcript-mute-btn .mic-icon,
.transcript-mute-btn .mute-icon {
    transition: opacity 0.2s ease;
}

.transcript-mute-btn .mute-icon {
    position: absolute;
}

/* Clear button in transcript card */
.transcript-clear-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(248, 250, 252, 0.95);
    color: #475569;
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.transcript-clear-btn:hover {
    background: rgba(226, 232, 240, 0.95);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.8);
}

.stop-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1f2937;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#jwt-token {
    padding: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

/* Authentication buttons */
.auth-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.retry-btn, .manual-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.manual-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.manual-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

#auth-form button {
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

#auth-form button[type="submit"] {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.cancel-btn {
    background: #f87171 !important;
    color: white !important;
}

.cancel-btn:hover {
    background: #ef4444 !important;
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.overlay.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.overlay p {
    font-size: 1.125rem;
    color: #374151;
    font-weight: 500;
}

/* Desktop layout - when width > height (landscape/desktop) */
@media (min-width: 769px) and (orientation: landscape) {
    .app-main {
        flex-direction: row;
    }
    
    .transcript-section {
        flex: 1; /* 1/4 of the space */
        margin: 0.5rem 0.25rem 0.5rem 0.5rem;
    }
    
    .answer-section {
        flex: 3; /* 3/4 of the space */
        margin: 0.0;
    }
    
    .floating-buttons {
        left: 62.5%; /* Position in center for desktop */
        transform: translateX(-50%);
    }
}

/* For larger desktop screens */
@media (min-width: 1024px) {
    .app-main {
        flex-direction: row;
    }
    
    .transcript-section {
        flex: 1; /* 1/4 of the space */
        margin: 0.5rem 0.25rem 0.5rem 0.5rem;
    }
    
    .answer-section {
        flex: 3; /* 3/4 of the space */
        margin: 0.0rem;
    }
    
    .floating-buttons {
        left: 62.5%; /* Position in center for desktop */
        transform: translateX(-50%);
    }
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .app-header {
        padding: 0.5rem 1rem;
    }
    
    .app-header h1 {
        font-size: 1.125rem;
    }
    
    .section-header {
        padding: 0.5rem 0.75rem;
    }
    
    .section-header h2 {
        font-size: 0.875rem;
    }
    
    .generate-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8125rem;
    }
    
    .answer-scroll-area,
    .transcript-scroll-area {
        padding: 0.75rem 0.75rem 4rem 0.75rem;
    }
    
    .transcript-scroll-area {
        padding: 0.75rem;
    }
    
    .floating-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        white-space: nowrap;
        width: auto;
        min-width: fit-content;
        border-radius: 50px;
        gap: 0.5rem;
    }
    
    .stop-btn, .clear-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8125rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Microphone selector mobile adjustments */
    .mic-selector-btn {
        min-width: 100px;
        font-size: 0.8125rem;
        padding: 0.4rem 0.6rem;
    }
    
    .mic-selector-text {
        max-width: 80px;
    }
    
    .mic-dropdown {
        min-width: 200px;
        max-height: 240px;
    }
    
    .mic-dropdown-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .mic-option {
        padding: 0.6rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    
    /* Mobile button adjustments - slightly bigger for better touch targets */
    .transcript-scroll-btn {
        width: 44px;
        height: 44px;
        bottom: 7.25rem;
        right: 0.75rem;
    }
    
    .transcript-mute-btn {
        width: 44px;
        height: 44px;
        bottom: 3.75rem;
        right: 0.75rem;
    }
    
    .transcript-clear-btn {
        width: 44px;
        height: 44px;
        bottom: 0.75rem;
        right: 0.75rem;
    }
    
    /* Mobile language selector adjustments */
    .language-selector {
        padding: 1.5rem;
    }
    
    .language-header h3 {
        font-size: 1.25rem;
    }
    
    .popular-languages,
    .additional-languages {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .language-option {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }
    
    .language-flag {
        font-size: 1.125rem;
    }
    
    /* Mobile microphone selection adjustments */
    .mic-selection-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .mic-selection-header h4 {
        font-size: 1.125rem;
    }
    
    .mic-radio-option {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .app-header {
        padding: 0.5rem 0.75rem;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    /* Extra compact microphone selector for very small screens */
    .mic-selector-btn {
        min-width: 80px;
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        gap: 0.375rem;
    }
    
    .mic-selector-text {
        max-width: 60px;
        font-size: 0.75rem;
    }
    
    .mic-dropdown {
        min-width: 180px;
        max-height: 200px;
        left: -20px;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    
    /* Compact but still touch-friendly buttons for very small screens */
    .transcript-scroll-btn {
        width: 40px;
        height: 40px;
        bottom: 7rem;
        right: 0.5rem;
    }
    
    .transcript-mute-btn {
        width: 40px;
        height: 40px;
        bottom: 3.5rem;
        right: 0.5rem;
    }
    
    .transcript-clear-btn {
        width: 40px;
        height: 40px;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    /* Extra compact language selector for very small screens */
    .language-selector {
        padding: 1rem;
    }
    
    .language-header {
        margin-bottom: 1.5rem;
    }
    
    .language-header h3 {
        font-size: 1.125rem;
    }
    
    .language-option {
        padding: 0.75rem 0.875rem;
        gap: 0.5rem;
    }
    
    .language-flag {
        font-size: 1rem;
    }
    
    .show-more-btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    /* Extra compact microphone selection for very small screens */
    .mic-selection-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .mic-selection-header {
        margin-bottom: 1rem;
    }
    
    .mic-selection-header h4 {
        font-size: 1rem;
    }
    
    .mic-radio-option {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
    
    .mic-radio-list {
        gap: 0.5rem;
    }
    
    .transcript-status {
        font-size: 0.6875rem;
        padding: 0.375rem 0.75rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .answer-section {
        margin: 0.0rem;
    }
    
    .transcript-section {
        margin: 0.25rem;
    }
    
    .section-header {
        padding: 0.5rem;
    }
    
    .answer-scroll-area,
    .transcript-scroll-area {
        padding: 0.5rem 0.5rem 4rem 0.5rem;
    }
    
    .transcript-scroll-area {
        padding: 0.5rem;
    }
    
    .floating-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
        width: auto;
        min-width: fit-content;
        border-radius: 50px;
        gap: 0.5rem;
    }
    
    .floating-buttons {
        bottom: 0.5rem;
    }
    
    .user-avatar-btn {
        width: 38px; /* Match mobile button height: 0.75*2 + 0.875 + 2px border = ~38px */
        height: 38px;
    }
    
    .user-menu-popup {
        min-width: 240px;
    }
    
    .stop-btn, .clear-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Authentication Modal Styles */
/* Authentication Modal Styles - Professional Design */
.auth-modal-content {
    max-width: 480px;
    padding: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}

.auth-header h2 {
    margin: 0;
    color: #111827;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
}

.auth-providers {
    padding: 1.5rem 2rem;
}

.primary-providers {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.secondary-providers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.oauth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.oauth-btn:hover::before {
    left: 100%;
}

.oauth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.oauth-btn span {
    white-space: nowrap;
}

/* Provider-specific styling */
.google-btn:hover {
    border-color: #4285f4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.github-btn {
    color: #24292e;
}

.github-btn:hover {
    border-color: #24292e;
    background: #f6f8fa;
    box-shadow: 0 4px 12px rgba(36, 41, 46, 0.15);
}

.azure-btn {
    color: #0078d4;
}

.azure-btn:hover {
    border-color: #0078d4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

.facebook-btn {
    color: #1877f2;
}

.facebook-btn:hover {
    border-color: #1877f2;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2);
}

.twitter-btn {
    color: #1da1f2;
}

.twitter-btn:hover {
    border-color: #1da1f2;
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.2);
}

.phone-btn {
    color: #059669;
}

.phone-btn:hover {
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.solana-btn {
    color: #9945ff;
}

.solana-btn:hover {
    border-color: #9945ff;
    box-shadow: 0 4px 12px rgba(153, 69, 255, 0.2);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 2rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

.divider span {
    padding: 0 1.5rem;
    background: white;
}

.email-form {
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #f97316;
    background: white;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.input-group input::placeholder {
    color: #9ca3af;
}

.submit-btn {
    padding: 1rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.auth-footer {
    padding: 1.5rem 2rem 2rem;
    text-align: center;
    border-top: 1px solid #f3f4f6;
}

.toggle-btn {
    background: none;
    border: none;
    color: #f97316;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    margin-bottom: 1rem;
}

.toggle-btn:hover {
    color: #ea580c;
}

.auth-help {
    margin-top: 1rem;
}

.help-link {
    color: #6b7280;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.help-link:hover {
    color: #374151;
}

/* Mobile Responsiveness for Authentication Modal */
@media (max-width: 768px) {
    .auth-modal-content {
        max-width: 95vw;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .auth-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-subtitle {
        font-size: 0.875rem;
    }
    
    .auth-providers {
        padding: 1rem 1.5rem;
    }
    
    .secondary-providers {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .oauth-btn {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .oauth-btn span {
        font-size: 0.875rem;
    }
    
    .divider {
        margin: 1rem 1.5rem;
    }
    
    .email-form {
        padding: 0 1.5rem;
    }
    
    .auth-footer {
        padding: 1rem 1.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-modal-content {
        margin: 0.5rem;
        border-radius: 8px;
    }
    
    .auth-header {
        padding: 1rem;
    }
    
    .auth-header h2 {
        font-size: 1.25rem;
    }
    
    .auth-subtitle {
        font-size: 0.8rem;
    }
    
    .auth-providers {
        padding: 0.75rem 1rem;
    }
    
    .oauth-btn {
        padding: 0.875rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .oauth-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .divider {
        margin: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .email-form {
        padding: 0 1rem;
    }
    
    .input-group input {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    .submit-btn {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    .auth-footer {
        padding: 0.75rem 1rem 1rem;
    }
    
    .toggle-btn {
        font-size: 0.8rem;
    }
    
    .help-link {
        font-size: 0.75rem;
    }
}

/* Upgrade Modal Styles - Clean White/Gray Theme */
.upgrade-modal-content {
    max-width: 1000px;
    padding: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #1f2937;
}

.modal-header {
    padding: 1.5rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Billing Toggle Styles */
.billing-toggle {
    padding: 1rem 2rem 0;
    display: flex;
    justify-content: center;
}

.billing-toggle-container {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    position: relative;
}

.billing-toggle-btn {
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.billing-toggle-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.discount-badge {
    background: #10b981;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    margin-left: 0.375rem;
}

/* Pricing Display Styles */
.original-price {
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-top: 0.25rem;
}

.quarterly-price {
    display: none;
}

.quarterly-price.show {
    display: block;
}

.monthly-price.hide {
    display: none;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.plan-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.plan-card:hover {
    border-color: #f97316;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.plan-card.popular {
    border-color: #f97316;
    box-shadow: 0 4px 15px -3px rgba(249, 115, 22, 0.1);
}

.plan-card.current {
    background: #f9fafb;
    border-color: #d1d5db;
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f97316;
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.plan-header {
    margin-bottom: 1.5rem;
}

.plan-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
}

.price {
    font-size: 2rem;
    font-weight: 800;
    color: #f97316;
    margin: 0;
    line-height: 1;
}

.price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
}

.monthly-price,
.quarterly-price,
.free-price {
    font-size: 2rem;
    font-weight: 800;
    color: #f97316;
    margin: 0;
    line-height: 1;
    display: block;
}

.monthly-price span,
.quarterly-price span,
.free-price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
}

.price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
}

.plan-features {
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
    text-align: left;
    flex-grow: 1;
}

.plan-features li {
    padding: 0.5rem 0;
    color: #4b5563;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    line-height: 1.4;
}

.plan-features li strong {
    margin-right: 0.25rem;
}

.feature-icon {
    color: #10b981;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.plan-button {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.plan-button:not([disabled]) {
    background: #f97316;
    color: white;
}

.plan-button:not([disabled]):hover {
    background: #ea580c;
    transform: translateY(-1px);
}

.plan-button.current-plan {
    background: #e5e7eb;
    color: #6b7280;
    cursor: not-allowed;
}

.plan-button.downgrade {
    background: #dc2626;
    color: white;
}

.plan-button.downgrade:hover {
    background: #b91c1c;
}

.modal-footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.plan-note {
    margin: 0;
    color: #6b7280;
    font-size: 0.8rem;
}

/* Mobile Responsiveness for Upgrade Modal */
@media (max-width: 768px) {
    .upgrade-modal-content {
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .plan-card {
        padding: 1.25rem;
    }
    
    .plan-card.popular {
        box-shadow: 0 4px 15px -3px rgba(249, 115, 22, 0.1);
    }
    
    .plan-card h3 {
        font-size: 1.25rem;
    }
    
    .price {
        font-size: 1.75rem;
    }
    
    .plan-features li {
        font-size: 0.8rem;
        padding: 0.375rem 0;
    }
    
    .modal-footer {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .upgrade-modal-content {
        border-radius: 8px;
        margin: 0.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-subtitle {
        font-size: 0.8rem;
    }
    
    .plan-card {
        padding: 1rem;
    }
    
    .plan-card h3 {
        font-size: 1.125rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    .plan-features li {
        font-size: 0.75rem;
    }
    
    .plan-button {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
}

/* Modal close button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Light theme close button for upgrade modal */
.upgrade-modal-content .modal-close {
    color: #6b7280;
}

.upgrade-modal-content .modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Downgrade/Cancel Modal Styles */
.downgrade-modal-content {
    max-width: 500px;
    padding: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #1f2937;
}

.downgrade-header {
    padding: 1.5rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.downgrade-header h2 {
    margin: 0;
    color: #dc2626;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.downgrade-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.downgrade-details {
    padding: 1.5rem 2rem;
}

.plan-change-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.current-plan-info, .new-plan-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.plan-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
}

.plan-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.arrow {
    font-size: 1.25rem;
    color: #6b7280;
    font-weight: bold;
}

.change-effects h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.change-effects ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.change-effects li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.change-effects li::before {
    content: '•';
    color: #dc2626;
    font-weight: bold;
}

.billing-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    border: 1px solid #fcd34d;
}

.billing-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #92400e;
    text-align: center;
}

.downgrade-actions {
    padding: 1rem 2rem 1.5rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid #e5e7eb;
}

.confirm-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.cancel-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

@media (max-width: 768px) {
    .downgrade-modal-content {
        max-width: 95vw;
        margin: 1rem;
    }
    
    .downgrade-header {
        padding: 1rem;
    }
    
    .downgrade-details {
        padding: 1rem;
    }
    
    .plan-change-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .downgrade-actions {
        padding: 1rem;
        flex-direction: column;
    }
}

/* Error and Success Messages */
.error-message, .success-message {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: none;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Payment Methods Info */
.payment-methods-info {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.payment-methods-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.payment-methods-list {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.payment-method {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.payment-security {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Regional payment method specific styles */
.payment-method.alipay {
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
    color: white;
    border: none;
}

.payment-method.wechat {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: white;
    border: none;
}

.payment-method.apple-pay {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    border: none;
}

.payment-method.google-pay {
    background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: white;
    border: none;
}

/* Responsive payment methods */
@media (max-width: 640px) {
    .payment-methods-list {
        gap: 0.5rem;
    }
    
    .payment-method {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Subscription prompt styling for Generate Answer button */
.floating-btn.generate.subscription-prompt {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #d97706 !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

.floating-btn.generate.subscription-prompt::before {
    background-image: none !important;
}

.floating-btn.generate.subscription-prompt:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #b45309 !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.floating-btn.generate.subscription-prompt:hover::before {
    background-image: none !important;
}


.auth-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(147, 51, 234, 0.15);
    color: #7c3aed;
    border: 1px solid rgba(147, 51, 234, 0.2);
}

.auth-btn::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%237c3aed" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M21 12H9"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.auth-btn:hover {
    background: rgba(147, 51, 234, 0.25);
    color: #6d28d9;
    border-color: rgba(147, 51, 234, 0.3);
}

.auth-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236d28d9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M21 12H9"></path></svg>');
}


.upgrade-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.upgrade-btn::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"></polygon></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.upgrade-btn:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}

.upgrade-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23b45309" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"></polygon></svg>');
}

/* User Avatar positioned in AI section */
.answer-section {
    position: relative;
}

.user-profile-avatar {
    position: absolute;
    bottom: 0.25rem; /* Same as floating-buttons bottom */
    left: 0.25rem;
    z-index: 15;
}

.user-avatar-btn {
    height: 42px; /* Same as button height (1rem padding + 1rem font + 1rem padding + borders) */
    width: 42px;
    border-radius: 50%;
    cursor: pointer;
    /* border: 2px solid rgba(255, 255, 255, 0.8); */
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.user-avatar-btn:hover {
    border-color: rgba(249, 115, 22, 0.6);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

/* User Menu Popup */
.user-menu-popup {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(234, 88, 12, 0.08);
    border-radius: 16px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.08),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(234, 88, 12, 0.05);
    min-width: 300px;
    max-width: 320px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: top right;
    overflow: hidden;
    pointer-events: none;
}

.user-menu-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-menu-popup.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.95);
    pointer-events: none;
}

.user-menu-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid rgba(234, 88, 12, 0.08);
    border-top: 1px solid rgba(234, 88, 12, 0.08);
    transform: rotate(45deg);
    z-index: -1;
}

.user-menu-header {
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    background: linear-gradient(135deg, #fef3f0 0%, #fff7ed 100%);
    border-bottom: 1px solid rgba(234, 88, 12, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-menu-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(234, 88, 12, 0.1) 50%, transparent 100%);
}

.user-avatar-menu {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid rgba(234, 88, 12, 0.15);
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.08);
    transition: all 0.2s ease;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #1c1917;
    font-size: 0.9375rem;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.8125rem;
    color: #ea580c;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.5rem;
    background: rgba(234, 88, 12, 0.08);
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.user-sessions {
    font-size: 0.75rem;
    color: #78716c;
    font-weight: 500;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    opacity: 0.8;
}

.user-menu-actions {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    background: #ffffff;
}

.user-menu-actions .preferences-btn,
.user-menu-actions .upgrade-btn,
.user-menu-actions .how-it-works-btn,
.user-menu-actions .manage-btn,
.user-menu-actions .logout-btn {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.user-menu-actions .preferences-btn::before,
.user-menu-actions .upgrade-btn::before,
.user-menu-actions .how-it-works-btn::before,
.user-menu-actions .manage-btn::before,
.user-menu-actions .logout-btn::before {
    content: '';
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

/* Preferences Button */
.user-menu-actions .preferences-btn {
    background: rgba(120, 113, 108, 0.06);
    color: #78716c;
}

.user-menu-actions .preferences-btn::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2378716c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>');
}

.user-menu-actions .preferences-btn:hover {
    background: rgba(120, 113, 108, 0.12);
    color: #57534e;
}

.user-menu-actions .preferences-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2357534e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>');
}

/* Upgrade Button */
.user-menu-actions .upgrade-btn {
    background: rgba(120, 113, 108, 0.06);
    color: #78716c;
}

.user-menu-actions .upgrade-btn::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2378716c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13,2 3,14 12,14 11,22 21,10 12,10"></polygon></svg>');
}

.user-menu-actions .upgrade-btn:hover {
    background: rgba(120, 113, 108, 0.12);
    color: #57534e;
}

.user-menu-actions .upgrade-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2357534e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13,2 3,14 12,14 11,22 21,10 12,10"></polygon></svg>');
}

/* How it works Button */
.user-menu-actions .how-it-works-btn {
    background: rgba(120, 113, 108, 0.06);
    color: #78716c;
}

.user-menu-actions .how-it-works-btn::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2378716c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>');
}

.user-menu-actions .how-it-works-btn:hover {
    background: rgba(120, 113, 108, 0.12);
    color: #57534e;
}

.user-menu-actions .how-it-works-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%2357534e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>');
}

/* Manage Button (if present) */
.user-menu-actions .manage-btn {
    background: rgba(234, 88, 12, 0.08);
    color: #ea580c;
}

.user-menu-actions .manage-btn::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23ea580c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M12 1v6m0 6v6m11-7h-6m-6 0H1"></path></svg>');
}

.user-menu-actions .manage-btn:hover {
    background: rgba(234, 88, 12, 0.15);
    color: #c2410c;
}

.user-menu-actions .manage-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23c2410c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M12 1v6m0 6v6m11-7h-6m-6 0H1"></path></svg>');
}

/* Logout Button */
.user-menu-actions .logout-btn {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.user-menu-actions .logout-btn::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9"></path></svg>');
}

.user-menu-actions .logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.user-menu-actions .logout-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23b91c1c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9"></path></svg>');
}

/* Mobile optimizations for user menu */
@media (max-width: 768px) {
    .user-menu-popup {
        right: -0.5rem;
        min-width: 280px;
        max-width: calc(100vw - 1rem);
        box-shadow: 
            0 20px 25px -5px rgba(0, 0, 0, 0.15),
            0 10px 10px -5px rgba(0, 0, 0, 0.08);
    }
    
    .user-menu-popup::before {
        right: 1rem;
    }
    
    .user-menu-header {
        padding: 1rem 1rem 0.875rem 1rem;
    }
    
    .user-menu-actions {
        padding: 0.875rem 1rem 1rem 1rem;
        gap: 0.5rem;
    }
    
    .user-menu-actions .preferences-btn,
    .user-menu-actions .upgrade-btn,
    .user-menu-actions .how-it-works-btn,
    .user-menu-actions .manage-btn,
    .user-menu-actions .logout-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
    
    .user-avatar-menu {
        width: 48px;
        height: 48px;
    }
    
    .user-name {
        font-size: 0.875rem;
    }
    
    .user-plan {
        font-size: 0.75rem;
        padding: 0.1875rem 0.375rem;
    }
}

@media (max-width: 640px) {
    .user-menu-popup {
        bottom: calc(100% + 0.5rem);
        right: -1rem;
        min-width: 260px;
        max-width: calc(100vw - 0.5rem);
        transform: translateY(8px) scale(0.96);
        transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .user-menu-popup.show {
        transform: translateY(0) scale(1);
    }
    
    .user-menu-popup::before {
        right: 1.25rem;
    }
    
    .user-menu-header {
        padding: 0.875rem 1rem 0.75rem 1rem;
        gap: 0.875rem;
    }
    
    .user-menu-actions {
        padding: 0.75rem 1rem 0.875rem 1rem;
    }
    
    .user-menu-actions .preferences-btn,
    .user-menu-actions .upgrade-btn,
    .user-menu-actions .how-it-works-btn,
    .user-menu-actions .manage-btn,
    .user-menu-actions .logout-btn {
        padding: 0.8125rem 0.875rem;
        font-size: 0.875rem;
        gap: 0.625rem;
        border-radius: 10px;
    }
    
    .user-menu-actions .preferences-btn::before,
    .user-menu-actions .upgrade-btn::before,
    .user-menu-actions .how-it-works-btn::before,
    .user-menu-actions .manage-btn::before,
    .user-menu-actions .logout-btn::before {
        width: 16px;
        height: 16px;
    }
    
    .user-avatar-menu {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }
    
    .user-name {
        font-size: 0.8125rem;
    }
    
    .user-plan {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
    
    .user-sessions {
        font-size: 0.6875rem;
    }
}

/* Mobile optimization for Generate Answer button */
@media (max-width: 640px) {
    .floating-btn.generate {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        white-space: nowrap;
        width: auto;
        min-width: fit-content;
        max-width: calc(100vw - 2rem);
        box-sizing: border-box;
        border-radius: 50px;
        gap: 0.5rem;
    }
    
    /* Ensure subscription prompt text fits on mobile */
    .floating-btn.generate.subscription-prompt {
        font-size: 0.875rem;
        padding: 0.75rem 1.25rem;
        white-space: nowrap;
        width: auto;
        min-width: fit-content;
        border-radius: 50px;
        gap: 0.5rem;
    }
    
    /* Make floating buttons container responsive */
    .floating-buttons {
        padding: 0 1rem;
        gap: 0.75rem;
    }
}

/* User Preferences Modal Styles */
.preferences-modal-content {
    max-width: 600px;
    padding: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.preferences-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.preferences-header h2 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.75rem;
    font-weight: 700;
}

.preferences-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 400;
}

.preferences-form {
    padding: 2rem;
}

.preference-group {
    margin-bottom: 2rem;
    position: relative;
}

.preference-group:last-of-type {
    margin-bottom: 1.5rem;
}

.preference-label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.label-text {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.label-subtitle {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

.preference-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    background: white;
    transition: all 0.2s ease;
}

.preference-select:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.preference-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    background: white;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.preference-textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.character-count {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.character-count.over-limit {
    color: #dc2626;
}

.preferences-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.save-preferences-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-preferences-btn:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

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

.save-preferences-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Verbosity Segmented Control Styles */
.verbosity-segmented-control {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-top: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.verbosity-radio {
    display: none;
}

.verbosity-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    margin: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
    color: #6b7280;
    text-align: center;
    min-height: 44px;
}

.verbosity-segment:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.6);
}

.verbosity-segment .segment-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.125rem;
    display: block;
}


.verbosity-radio:checked + .verbosity-segment {
    background: white;
    color: #f97316;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transform: translateY(0);
}

.verbosity-radio:checked + .verbosity-segment .segment-title {
    font-weight: 700;
}


/* Focus states for accessibility */
.verbosity-radio:focus + .verbosity-segment {
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

/* Active state animation */
.verbosity-radio:checked + .verbosity-segment {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Preference Language Dropdown Styles */
.preference-language-dropdown {
    margin-top: 0.5rem;
}

.preference-language-dropdown .dropdown-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.preference-language-dropdown .dropdown-btn:hover {
    border-color: #9ca3af;
}

.preference-language-dropdown .dropdown-btn:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.preference-language-dropdown .dropdown-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preference-language-dropdown .language-flag {
    font-size: 1rem;
}

.preference-language-dropdown .dropdown-text {
    color: #374151;
    font-weight: 500;
}

.preference-language-dropdown .dropdown-arrow {
    color: #6b7280;
    transition: transform 0.2s ease;
}

.preference-language-dropdown .dropdown-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.preference-language-dropdown .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 0.25rem;
}

.preference-language-dropdown .dropdown-content.show {
    display: block;
}

.preference-language-dropdown .dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.preference-language-dropdown .dropdown-option:hover {
    background: #f3f4f6;
}

.preference-language-dropdown .dropdown-option.selected {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    font-weight: 600;
}

.preference-language-dropdown .dropdown-option .language-flag {
    font-size: 1rem;
}

.preference-language-dropdown .dropdown-option .option-text {
    flex: 1;
}

.cancel-preferences-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-preferences-btn:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}

.preferences-btn {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.preferences-btn::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233b82f6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 1v6m0 6v6m11-7h-6m-6 0H1"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.preferences-btn:hover {
    background: rgba(249, 115, 22, 0.15);
    color: #ea580c;
    border-color: rgba(249, 115, 22, 0.3);
}

.preferences-btn:hover::before {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23ea580c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 1v6m0 6v6m11-7h-6m-6 0H1"/></svg>');
}

/* Mobile Responsiveness for Preferences Modal */
@media (max-width: 768px) {
    .preferences-modal-content {
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
        margin: 1rem;
    }
    
    .preferences-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .preferences-header h2 {
        font-size: 1.5rem;
    }
    
    .preferences-form {
        padding: 1.5rem;
    }
    
    .preferences-actions {
        gap: 0.75rem;
    }
    
    .save-preferences-btn,
    .cancel-preferences-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .preferences-modal-content {
        border-radius: 8px;
        margin: 0.5rem;
    }
    
    .preferences-header h2 {
        font-size: 1.25rem;
    }
    
    .preferences-subtitle {
        font-size: 0.8125rem;
    }
    
    .preferences-actions {
        flex-direction: column;
    }
    
    .save-preferences-btn,
    .cancel-preferences-btn {
        width: 100%;
    }
    
    /* Mobile responsiveness for segmented control - keep horizontal layout */
    .verbosity-segment {
        padding: 0.5rem 0.25rem;
        min-height: 40px;
    }
    
    .verbosity-segment .segment-title {
        font-size: 0.8125rem;
    }
}

/* AI Toolbar Styles */
.ai-toolbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)); /* Add safe area */
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-radius: 32px 32px 0 0;
    width: 100%;
    max-width: 50%;
    min-width: 320px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    visibility: visible !important;
    opacity: 1 !important;
}

/* Desktop layout adjustments */
@media (min-width: 769px) and (orientation: landscape) {
    .ai-toolbar {
        left: 62.5%; /* Position it in the center of the right half (answer section) */
        max-width: calc(50vw - 4rem); /* Constrain width to answer section minus gaps */
        min-width: 280px;
    }
}

@media (min-width: 1024px) {
    .ai-toolbar {
        left: 62.5%; /* Position it in the center of the right half (answer section) */
        max-width: calc(50vw - 4rem); /* Constrain width to answer section minus gaps */
        min-width: 300px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .ai-toolbar {
        width: 100%;
        max-width: 98vw;
        min-width: auto;
    }
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.toolbar-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.toolbar-btn:active {
    background: #f3f4f6;
}

.round-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 8px;
}

.long-btn {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    padding: 8px 16px;
    text-align: left;
    color: #6b7280;
    font-size: 14px;
    margin: 0 auto; /* Center the input */
    font-weight: 500;
    transition: all 0.2s ease;
}

.long-btn.primary {
    background: rgba(34, 197, 94, 0.15);
    color: #059669;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.long-btn.primary:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.3);
}

.long-btn.generate {
    background: rgba(249, 115, 22, 0.15);
    color: #c2410c;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.long-btn.generate:hover {
    background: rgba(249, 115, 22, 0.25);
    border-color: rgba(249, 115, 22, 0.3);
}

.long-btn.subscription-prompt {
    background: #f59e0b;
    color: white;
    border: 1px solid transparent;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.long-btn.subscription-prompt:hover {
    background: #d97706;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.long-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
}

.space-icon {
    margin-left: 8px;
    opacity: 0.7;
    vertical-align: middle;
}

.long-btn.generate:hover .space-icon {
    opacity: 1;
}

/* Toolbar button states */
.toolbar-btn:disabled {
    cursor: not-allowed;
}

.toolbar-btn.muted {
    background: rgba(248, 113, 113, 0.15);
    color: #dc2626;
    border-color: rgba(248, 113, 113, 0.3);
}

.toolbar-btn.muted:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.25);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.5);
}

.toolbar-btn .mic-icon,
.toolbar-btn .mute-icon {
    transition: opacity 0.2s ease;
}

.toolbar-btn .mute-icon {
    position: absolute;
}

/* Toolbar User Profile Styles */
.toolbar-user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar-container {
    position: relative;
    overflow: hidden;
}

.toolbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.default-user-icon {
    width: 16px;
    height: 16px;
}

.toolbar-user-profile .user-menu-popup {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.2s ease;
}

.toolbar-user-profile .user-menu-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Update usage info positioning since it's no longer in floating buttons */
.usage-info {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: all;
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-width: 400px;
    min-width: 320px;
    position: relative;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-warning {
    border-left: 3px solid #f59e0b;
    background: #ffffff;
}

.toast-warning .toast-title {
    color: #92400e;
}

.toast-error {
    border-left: 3px solid #ef4444;
    background: #ffffff;
}

.toast-error .toast-title {
    color: #dc2626;
}

.toast-success {
    border-left: 3px solid #10b981;
    background: #ffffff;
}

.toast-success .toast-title {
    color: #047857;
}

.toast-info {
    border-left: 3px solid #f97316;
    background: #ffffff;
}

.toast-info .toast-title {
    color: #c2410c;
}

.toast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    line-height: 1.3;
}

.toast-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.toast-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 6px;
    color: #9ca3af;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -0.25rem -0.25rem 0 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
    transform: scale(1.05);
}

.toast-close svg {
    width: 0.875rem;
    height: 0.875rem;
}

.toast-message {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #e5e7eb;
    border-radius: 0 0 8px 8px;
    transition: width linear;
    overflow: hidden;
}

.toast-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #f97316;
    transition: inherit;
}

.toast-warning .toast-progress::after {
    background: #f59e0b;
}

.toast-error .toast-progress::after {
    background: #ef4444;
}

.toast-success .toast-progress::after {
    background: #10b981;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .toast-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        transform: translateY(-100%);
        padding: 1rem;
        border-radius: 10px;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast.hide {
        transform: translateY(-100%);
    }
    
    .toast-header {
        margin-bottom: 0.625rem;
    }
    
    .toast-title {
        font-size: 0.875rem;
    }
    
    .toast-message {
        font-size: 0.8125rem;
    }
}

/* Swipe gesture support */
.toast.swiping {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.swipe-out {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
    .toast.swipe-out {
        transform: translateY(-100%);
    }
}

/* Enhanced hover states for better interaction */
.toast:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.toast.show:hover {
    transform: translateX(0) translateY(-1px);
}

@media (max-width: 640px) {
    .toast:hover {
        transform: translateY(-1px);
    }
    
    .toast.show:hover {
        transform: translateY(-1px);
    }
}

/* Toast upgrade button styling */
.toast-upgrade-btn {
    background: #f97316 !important;
    color: white !important;
    border: none !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.15s ease !important;
}

.toast-upgrade-btn:hover {
    background: #ea580c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3) !important;
}

/* Time Limited Recording Button */
.toolbar-btn.time-limited {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    animation: time-pulse 2s infinite;
}

@keyframes time-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(251, 191, 36, 0);
    }
}

