/* OpenBe Meet - Styles */

:root {
    /* OpenBe Colors */
    --cream-bg: #FFF8E7;
    --cream-card: #FFFFFF;
    --amber-accent: #F59E0B;
    --amber-light: #FFAF7B;
    --indigo-translation: #6366F1;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --success: #10B981;
    --danger: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-amber: 0 4px 12px rgba(245, 158, 11, 0.25);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--cream-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Access Restriction Screen */
.access-restriction {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cream-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.restriction-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    background: var(--cream-card);
    padding: 48px 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.restriction-logo {
    font-size: 80px;
    margin-bottom: 24px;
    animation: bounce 2s ease-in-out infinite;
}

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

.restriction-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.restriction-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.restriction-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--amber-accent), transparent);
    margin-bottom: 32px;
}

.restriction-info {
    text-align: left;
}

.restriction-hint {
    font-size: 14px;
    color: var(--amber-accent);
    font-weight: 600;
    margin-bottom: 16px;
}

.restriction-steps {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
}

.restriction-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 40px;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.restriction-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--amber-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--cream-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    color: var(--text-secondary);
}

.logout-button {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: var(--cream-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bee-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

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

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--cream-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: all 0.3s ease;
}

.status-dot.connected {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Control Panel */
.control-panel {
    background: var(--cream-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.language-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.language-select {
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-size: 16px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-select:hover {
    border-color: var(--amber-accent);
}

.language-select:focus {
    outline: none;
    border-color: var(--amber-accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.swap-button {
    margin-top: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.swap-button:hover {
    background: var(--amber-accent);
    color: white;
    transform: rotate(180deg);
}

.record-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--amber-accent), var(--amber-light));
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-amber);
}

.record-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

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

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

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25); }
    50% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.45); }
}

.record-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Translation Display */
.translation-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.live-section {
    background: var(--cream-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-height: 200px;
}

.live-section.translation {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.02));
    border: 2px solid rgba(99, 102, 241, 0.1);
}

.section-header {
    margin-bottom: 16px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber-accent);
    animation: pulse 2s ease-in-out infinite;
}

.live-section.translation .pulse-dot {
    background: var(--indigo-translation);
}

.live-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
    min-height: 120px;
}

.live-text:empty::before {
    content: "等待内容...";
    color: var(--text-secondary);
    font-style: italic;
}

/* History Section */
.history-section {
    background: var(--cream-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.clear-button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-button:hover {
    background: var(--cream-bg);
    border-color: var(--amber-accent);
    color: var(--amber-accent);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 16px;
    background: var(--cream-bg);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--amber-accent);
    transition: all 0.2s ease;
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.history-item-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.history-item-source {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.history-item-translation {
    font-size: 16px;
    color: var(--indigo-translation);
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--cream-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-header .bee-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--amber-accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

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

.code-input-group input {
    flex: 1;
}

.send-code-button {
    padding: 12px 20px;
    background: var(--cream-bg);
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.send-code-button:hover:not(:disabled) {
    background: var(--amber-accent);
    border-color: var(--amber-accent);
    color: white;
}

.send-code-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--amber-accent), var(--amber-light));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-amber);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

.login-hint {
    text-align: center;
    padding-top: 8px;
}

.login-hint p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 12px 0;
        margin-bottom: 16px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .bee-icon {
        font-size: 24px;
    }

    .header-right {
        gap: 8px;
    }

    .user-info {
        padding: 6px 12px;
        font-size: 12px;
    }

    .logout-button {
        padding: 4px 8px;
        font-size: 12px;
    }

    .status-indicator {
        padding: 6px 12px;
        font-size: 13px;
    }

    .control-panel {
        padding: 20px 16px;
    }

    .language-selector {
        flex-direction: column;
        gap: 12px;
    }

    .swap-button {
        transform: rotate(90deg);
        margin: 0;
    }

    .swap-button:hover {
        transform: rotate(270deg);
    }

    .record-button {
        padding: 16px;
        font-size: 16px;
    }

    .translation-display {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .live-section {
        padding: 16px;
        min-height: 150px;
    }

    .live-text {
        font-size: 16px;
    }

    .history-section {
        padding: 16px;
    }

    .history-item {
        padding: 12px;
    }

    .history-item-source,
    .history-item-translation {
        font-size: 14px;
    }

    /* 登录弹窗移动端优化 */
    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .modal-header .bee-icon {
        font-size: 40px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .input-group input {
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }

    .code-input-group {
        flex-direction: column;
    }

    .send-code-button {
        width: 100%;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .container {
        padding: 8px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .control-panel {
        padding: 16px 12px;
    }

    .record-button {
        font-size: 15px;
        padding: 14px;
    }

    .live-section {
        padding: 12px;
    }

    .live-text {
        font-size: 15px;
    }
}

/* iOS 安全区域适配 */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .container {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }
}

/* History Actions */
.history-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.save-button,
.view-records-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--amber-accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.save-button:hover,
.view-records-button:hover {
    background: var(--amber-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.save-button:active,
.view-records-button:active {
    transform: translateY(0);
}

.view-records-button {
    background: var(--indigo-translation);
}

.view-records-button:hover {
    background: #4F46E5;
}

/* History Modal */
.history-modal,
.detail-modal {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-modal .modal-header,
.detail-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--cream-bg);
}

.history-modal .modal-header h2,
.detail-modal .modal-header h2 {
    text-align: left;
    margin: 0;
}

.close-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-button:hover {
    background: var(--cream-bg);
    color: var(--text-primary);
}

.history-modal .modal-body,
.detail-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    margin: 0 -40px;
    padding: 0 40px;
}

/* Records List */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-card {
    background: var(--cream-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.record-card:hover {
    border-color: var(--amber-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.record-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.record-card-info {
    flex: 1;
}

.record-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.record-card-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.record-card-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background: var(--cream-card);
    color: var(--text-primary);
}

.icon-button.delete:hover {
    color: var(--danger);
}

.record-card-preview {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Record Detail */
.detail-header {
    margin-bottom: 24px;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--cream-bg);
}

.action-button {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--amber-accent);
    background: transparent;
    color: var(--amber-accent);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-button:hover {
    background: var(--amber-accent);
    color: white;
}

.action-button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.action-button.danger:hover {
    background: var(--danger);
    color: white;
}

/* AI Summary Section */
.ai-summary-section {
    background: var(--cream-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    border: 2px solid var(--amber-accent);
    box-shadow: var(--shadow-md);
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--amber-accent);
}

.ai-summary-header svg {
    flex-shrink: 0;
}

.ai-summary-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.ai-summary-content {
    min-height: 60px;
}

.ai-summary-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.ai-summary-loading .spinner {
    margin-bottom: 16px;
}

.ai-summary-loading p {
    font-size: 14px;
    text-align: center;
}

.ai-summary-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.ai-summary-text h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 16px 0 8px 0;
}

.ai-summary-text h4:first-child {
    margin-top: 0;
}

.ai-summary-text p {
    margin: 8px 0;
}

.ai-summary-text li {
    margin: 6px 0 6px 20px;
    list-style-type: disc;
}

.ai-summary-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--cream-bg);
    font-size: 12px;
    color: var(--text-secondary);
}

.ai-summary-footer svg {
    flex-shrink: 0;
}

.ai-summary-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--danger);
    text-align: center;
}

.ai-summary-error svg {
    margin-bottom: 12px;
}

.ai-summary-error p {
    font-size: 14px;
    margin-bottom: 16px;
}

.retry-button {
    padding: 8px 20px;
    background: var(--amber-accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background: var(--amber-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.ai-summary-button {
    border-color: var(--amber-accent);
    color: var(--amber-accent);
}

.ai-summary-button:hover {
    background: var(--amber-accent);
    color: white;
}

.ai-summary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-summary-button:disabled:hover {
    background: transparent;
    color: var(--amber-accent);
    transform: none;
}

.segments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.segment-item {
    background: var(--cream-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.segment-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.segment-source {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.segment-translation {
    font-size: 15px;
    color: var(--indigo-translation);
    line-height: 1.6;
    padding-left: 12px;
    border-left: 3px solid var(--indigo-translation);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cream-bg);
    border-top-color: var(--amber-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Success Message */
.success-message {
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Mobile Responsive for History */
@media (max-width: 768px) {
    .history-actions {
        flex-wrap: wrap;
    }

    .save-button,
    .view-records-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .save-button svg,
    .view-records-button svg {
        width: 14px;
        height: 14px;
    }

    .history-modal,
    .detail-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px;
    }

    .history-modal .modal-body,
    .detail-modal .modal-body {
        margin: 0 -20px;
        padding: 0 20px;
    }

    .record-card {
        padding: 12px;
    }

    .record-card-title {
        font-size: 15px;
    }

    .record-card-meta {
        flex-direction: column;
        gap: 4px;
    }

    .detail-title {
        font-size: 18px;
    }

    .detail-meta {
        flex-direction: column;
        gap: 8px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }

    .ai-summary-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .ai-summary-header h3 {
        font-size: 16px;
    }

    .ai-summary-text {
        font-size: 14px;
    }

    .ai-summary-text h4 {
        font-size: 15px;
    }

    .ai-summary-loading,
    .ai-summary-error {
        padding: 30px 16px;
    }
}

/* Timer Display */
.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--amber-accent);
    border-radius: var(--radius-lg);
    color: var(--amber-accent);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    animation: timer-pulse 2s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% {
        border-color: var(--amber-accent);
        background: rgba(245, 158, 11, 0.1);
    }
    50% {
        border-color: var(--amber-light);
        background: rgba(245, 158, 11, 0.15);
    }
}

.timer-display svg {
    animation: timer-tick 1s ease-in-out infinite;
}

@keyframes timer-tick {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(6deg); }
}

/* Audio Player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--cream-bg);
    border-radius: var(--radius-lg);
    margin-top: 16px;
}

.audio-play-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber-accent), var(--amber-light));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-amber);
    flex-shrink: 0;
}

.audio-play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.audio-play-button:active {
    transform: scale(0.95);
}

.audio-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-progress {
    width: 100%;
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.audio-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--amber-accent), var(--amber-light));
    width: 0%;
    transition: width 0.1s linear;
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Mobile Responsive for Timer and Audio */
@media (max-width: 768px) {
    .timer-display {
        padding: 10px 16px;
        font-size: 18px;
        margin-bottom: 12px;
    }

    .timer-display svg {
        width: 18px;
        height: 18px;
    }

    .audio-player {
        padding: 12px;
    }

    .audio-play-button {
        width: 40px;
        height: 40px;
    }

    .audio-play-button svg {
        width: 18px;
        height: 18px;
    }
}

/* Email Modal */
.email-modal {
    max-width: 480px;
}

.email-modal .modal-body {
    padding: 24px;
}

.email-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    margin-bottom: 24px;
}

.email-hint svg {
    flex-shrink: 0;
    color: var(--amber-accent);
    margin-top: 2px;
}

.email-hint span {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.email-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cancel-button {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--text-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-button:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.send-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--amber-accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-amber);
}

.send-button:hover {
    background: #D97706;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

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

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.send-button svg {
    width: 16px;
    height: 16px;
}

/* Action Button Variants */
.action-button.export {
    background: var(--amber-accent);
    color: white;
}

.action-button.export:hover {
    background: #D97706;
}

.action-button.email {
    background: var(--indigo-translation);
    color: white;
}

.action-button.email:hover {
    background: #4F46E5;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toast-notification svg {
    flex-shrink: 0;
}

.toast-notification span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success svg {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error svg {
    color: var(--danger);
}

.toast-info {
    border-left: 4px solid var(--amber-accent);
}

.toast-info svg {
    color: var(--amber-accent);
}

/* Mobile Responsive for Email Modal */
@media (max-width: 768px) {
    .email-modal {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .email-actions {
        flex-direction: column-reverse;
    }

    .cancel-button,
    .send-button {
        width: 100%;
        justify-content: center;
    }

    .toast-notification {
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 20px;
    }

    .toast-notification.show {
        transform: translateY(0);
    }

    .toast-notification {
        transform: translateY(100px);
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .action-button {
        flex: 1 1 calc(50% - 6px);
        min-width: 140px;
    }
}

/* AI Summary Section */
.ai-summary-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.02));
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--indigo-translation);
}

.ai-summary-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.ai-summary-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.ai-summary-button {
    border-color: var(--indigo-translation);
    color: var(--indigo-translation);
}

.ai-summary-button:hover {
    background: var(--indigo-translation);
    color: white;
}
