
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Top Navigation Bar */
.top-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 60px;
}

.nav-left, .nav-right {
    width: 60px;
    display: flex;
    justify-content: center;
}

.nav-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn {
    background: none;
    border: none;
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.page-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #333;
}

.page-title.detail-title {
    flex-direction: column;
}

.page-title i {
    color: #667eea;
}

.title-container {
    display: flex;
    align-items: center;
}

.record-date {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    text-align: center;
}

.editable-title {
    cursor: pointer;
    border-bottom: 1px dotted transparent;
    transition: border-color 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editable-title:hover {
    border-bottom-color: #667eea;
}

.title-input {
    background: none;
    border: none;
    border-bottom: 2px solid #667eea;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
    min-width: 150px;
}

.edit-btn {
    background: none;
    border: none;
    margin-left: 4px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Main Content Areas */
.login-view {
    flex: 1;
    padding: 20px;
}

.home-view, .recording-view, .detail-view {
    flex: 1;
    padding-top: 60px; /* Match navigation height exactly */
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

/* Login View */
.login-view {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.form-input.error {
    border-color: #f44336;
}

.form-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
}

.form-help {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.form-textarea {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(244, 67, 54, 0.3);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 10px;
}

/* Authentication Required View */
.auth-required-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}

.auth-required-content {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.auth-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.auth-required-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.auth-required-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

/* Home View */
.home-header {
    margin-top: 20px; /* Add space from navigation bar */
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.new-record-btn {
    background: linear-gradient(135deg, #8e5edc, #764ba2);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
}

.new-record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.upload-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.record-item {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
}

.record-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.record-info {
    flex: 1;
}

.record-header {
    display: flex;
    align-items: center;
    justify-content: left;
    margin-bottom: 4px;
}

.record-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    margin-left: 12px;
}

.record-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.records-controls {
    display: flex;
    justify-content: center;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sort-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sort-btn {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.sort-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.record-creator {
    font-weight: 500;
    color: #667eea;
    font-size: 14px;
}

.record-date {
    font-size: 14px;
}

.record-duration {
    font-size: 14px;
}

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

.action-btn {
    background: transparent;
    border: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn i {
    font-size: 13px;
    width: 13px;
    height: 13px;
    line-height: 13px;
}

.action-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    transform: scale(1.05);
}

/* Recording View - Removed wrapper, components are now independent */



.audio-visualizer {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.visualizer-bars {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 2px;
    height: 60px;
    margin-bottom: 12px;
}

.bar {
    width: 3px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 2px;
    min-height: 2px;
    transition: height 0.1s ease;
}

.recording-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 500;
}

.recording-info > span {
    display: flex;
    align-items: center;
    gap: 10px;
}


.auto-save-status {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
    /* margin-top: 5px; */
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auto-save-status.idle {
    color: #666;
    background: rgba(102, 102, 102, 0.1);
}

.auto-save-status.uploading {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.auto-save-status.success {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.auto-save-status.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.connection-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 10px;
    margin-top: 5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.status-indicator.online {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.status-indicator.offline {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.server-status.offline {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 4px;
    border-radius: 3px;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    font-weight: 500;
}

.failed-chunks {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 4px;
    border-radius: 3px;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    font-weight: 500;
}


.recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f44336;
    animation: blink 1s infinite;
}

.recording-dot.paused {
    background: #ff9800;
    animation: none;
}

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

.transcript-section {
    position: fixed;
    top: 80px; /* Below top navigation with 20px gap */
    left: 20px;
    right: 20px;
    height: calc(100vh - 80px - 150px); /* 100vh - top bar - bottom controls */
    z-index: 1;
    transition: height 0.3s ease;
}

.transcript-section.has-visualizer {
    height: calc(100vh - 80px - 320px); /* 100vh - top bar - bottom controls with visualizer */
}

.transcript-display {
    background: white;
    border-radius: 16px;
    padding: 20px;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.transcript-content {
    line-height: 1.6;
    font-size: 16px;
    color: #333;
}

.final-text {
    color: #333;
}

.current-text {
    color: #667eea;
    font-weight: 500;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 20px;
    background: #667eea;
    margin-left: 2px;
    animation: blink 1s infinite;
}

.transcript-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ccc;
    text-align: center;
}

.transcript-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
}

.bottom-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    max-width: calc(100vw - 40px); /* Ensure it doesn't exceed viewport */
    min-height: 90px; /* Minimum height for consistent spacing */
}

.control-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
}

.control-btn {
    background: white;
    border: 2px solid #e0e0e0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #666;
}

.control-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.record-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.record-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.record-btn.recording {
    background: #f44336;
    animation: pulse-record 2s infinite;
}

@keyframes pulse-record {
    0% { box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3); }
    50% { box-shadow: 0 8px 24px rgba(244, 67, 54, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3); }
}

/* Detail View */
.detail-view {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.audio-player {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px; /* Add space from navigation bar */
    margin-bottom: 20px;
}

.audio-control {
    width: 100%;
    height: 60px;
}

.transcript-detail {
    flex: 1;
    min-height: 0; /* Allow flex child to shrink for scrolling */
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-container {
    display: flex;
    flex-direction: column;
    flex: 1; /* Take all available space */
    min-height: 0; /* Allow flex child to shrink for scrolling */
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
    padding: 0 20px;
    gap: 4px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Allow flex child to shrink for scrolling */
    overflow: hidden;
    padding: 20px;
}

.tab-pane {
    flex: 1;
    min-height: 0; /* Allow flex child to shrink for scrolling */
    display: flex;
    flex-direction: column;
}

.tab-pane-content {
    flex: 1;
    min-height: 0; /* Allow scrolling to work properly */
    overflow-y: auto;
    padding-right: 10px;
    -webkit-overflow-scrolling: touch;
}

.tab-pane > h3 {
    margin-bottom: 16px;
    color: #333;
    display: flex;
    align-items: center;
}

.tab-pane > h3 i {
    color: var(--primary-color);
    font-size: 20px;
    margin-right: 8px;
}

.transcript-text {
    line-height: 1.6;
    font-size: 16px;
    color: #333;
    white-space: pre-wrap;
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin: 10px 0;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
}

.placeholder-content i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ddd;
}

.placeholder-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #666;
}

.placeholder-content p {
    font-size: 14px;
    max-width: 300px;
    line-height: 1.5;
}

.upload-record-info {
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: #333;
    min-width: 80px;
    margin-right: 16px;
}

.info-item span {
    color: #666;
    font-size: 14px;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

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

.modal-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-action-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.modal-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.modal-action-btn.danger {
    border-color: #f44336;
    color: #f44336;
}

.modal-action-btn.danger:hover {
    background: rgba(244, 67, 54, 0.1);
}

.modal-action-btn.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    color: #667eea;
}

.modal-action-btn i {
    width: 20px;
    text-align: center;
}

.selected-icon {
    margin-left: auto;
    color: #667eea;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    font-weight: 500;
    border-left: 4px solid #667eea;
}

.toast.error {
    border-left-color: #f44336;
    color: #f44336;
}

.toast.success {
    border-left-color: #4caf50;
    color: #4caf50;
}

/* Radio and Checkbox Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.radio-option input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-option input[type="radio"]:checked {
    border-color: #667eea;
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.radio-option:has(input[type="radio"]:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(158, 158, 158, 0.1);
}

.radio-option span {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.radio-option small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-option:has(input[type="checkbox"]:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-option:has(input[type="checkbox"]:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(158, 158, 158, 0.1);
}

.checkbox-option span {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.checkbox-option small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
}

/* Processing Status Styles */
.processing-status {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.processing-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.status-info i {
    font-size: 16px;
}

.status-actions {
    display: flex;
    gap: 12px;
}

.btn-refresh, .btn-reprocess {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-refresh:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.btn-reprocess {
    border-color: #ff9800;
    color: #ff9800;
}

.btn-reprocess:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.05);
}

.btn-refresh:disabled, .btn-reprocess:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-pending {
    color: #ff9800;
}

.status-processing {
    color: #667eea;
}

.status-completed {
    color: #4caf50;
}

.status-failed {
    color: #f44336;
}

/* SRT Display Styles */
.srt-content h3 {
    margin-bottom: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.srt-help {
    font-size: 12px;
    color: #666;
    font-weight: 400;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.srt-display {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.srt-display pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

/* Interactive SRT Blocks */
.srt-blocks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.srt-block {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.srt-block:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.srt-block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.speaker-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.timestamp {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    font-size: 12px;
    color: #555;
}

.duration {
    color: #999;
    font-size: 11px;
    font-weight: 400;
}

.srt-block-content {
    position: relative;
}

.srt-text {
    line-height: 1.5;
    color: #333;
    font-size: 14px;
    min-height: 20px;
}

.srt-edit {
    position: relative;
}

.srt-text-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 40px;
    background: #fafbff;
}

.srt-text-input:focus {
    outline: none;
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-hint {
    position: absolute;
    top: -25px;
    right: 0;
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}

.edit-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 8px;
    border: 4px solid transparent;
    border-top-color: #333;
}

/* Responsive adjustments for SRT blocks */
@media (max-width: 768px) {
    .srt-block {
        padding: 12px;
    }
    
    .srt-block-header {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .srt-help {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .edit-hint {
        position: static;
        margin-top: 4px;
        display: inline-block;
    }
    
    .edit-hint::after {
        display: none;
    }
}

/* Speaker Management Styles */
.speaker-management h3 {
    margin-bottom: 16px;
    color: #333;
}

.speaker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.speaker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.speaker-label {
    font-weight: 600;
    color: #667eea;
    min-width: 80px;
}

.speaker-input {
    flex: 1;
    margin: 0 !important;
}

.speaker-count {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

.speaker-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}



/* Responsive Design */
@media (max-width: 768px) {
    /* Hide Processing Status label on mobile to save space */
    .status-label {
        display: none;
    }

    .login-card {
        margin: 20px;
        padding: 30px;
    }
    
    .home-view, .detail-view {
        padding-top: 60px; /* Match navigation height exactly */
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 16px;
    }

    /* Mobile adjustments for independent transcript section */
    .transcript-section {
        left: 15px;
        right: 15px;
        top: 75px; /* Slightly less space from top on mobile */
        height: calc(100vh - 75px - 120px); /* 100vh - top bar - bottom controls on mobile */
    }

    .transcript-section.has-visualizer {
        height: calc(100vh - 75px - 290px); /* 100vh - top bar - bottom controls with visualizer on mobile */
    }

    /* Mobile adjustments for bottom controls */
    .bottom-controls {
        bottom: 15px;
        left: 15px;
        right: 15px;
        max-width: calc(100vw - 30px);
    }
    
    .editable-title {
        max-width: 190px;
    }
    
    .record-item {
        padding: 16px;
    }
    
    .record-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .control-row {
        gap: 12px;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    
    .record-btn {
        width: 64px;
        height: 64px;
        font-size: 20px;
    }
    
    
    .tab-nav {
        padding: 0 12px;
        gap: 2px;
        justify-content: center;
    }
    
    .tab-btn {
        padding: 10px 8px;
        font-size: 12px;
        flex: 1;
        text-align: center;
        min-width: 0;
    }
    
    .tab-content {
        padding: 16px;
    }
    
    .placeholder-content i {
        font-size: 36px;
    }
    
    .placeholder-content h3 {
        font-size: 18px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-item label {
        min-width: unset;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 10px 12px;
    }
    
    .nav-left, .nav-right {
        width: 50px;
    }
    
    .page-title {
        font-size: 14px;
    }
    
    .title-input {
        font-size: 14px;
        min-width: 120px;
    }
    
    .login-card {
        padding: 20px;
    }
    
    .home-view, .detail-view {
        padding-top: 60px; /* Match navigation height exactly */
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 12px;
    }
    
    .new-record-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .record-title {
        font-size: 16px;
    }
    
    .record-meta {
        font-size: 12px;
    }
    
    .visualizer-bars {
        height: 60px;
    }
    
    .bottom-controls {
        padding: 16px;
    }
    
    .control-row {
        gap: 8px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .record-btn {
        width: 54px;
        height: 54px;
        font-size: 18px;
    }
}

/* Upload Modal Styles */
.upload-modal {
    max-width: 500px;
    width: 90vw;
}

.upload-content {
    padding: 0;
}

.upload-info {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-info i {
    font-size: 24px;
    color: #667eea;
}

.file-details {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
    overflow: hidden;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.file-size {
    color: #666;
    font-size: 14px;
}

.progress-section {
    padding: 20px;
}

.progress-info {
    text-align: center;
}

.progress-label {
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-weight: 600;
    color: #667eea;
}

.processing-steps {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    color: #666;
    transition: all 0.3s ease;
}

.step.completed {
    background: #d4edda;
    color: #155724;
}

.step.active {
    background: #e2e3ff;
    color: #4c63d2;
}

.step i {
    width: 16px;
    text-align: center;
}

.success-info, .error-info {
    text-align: center;
}

.success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 15px;
}

.error-icon {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 15px;
}

.success-message {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 15px;
}

.error-message {
    font-size: 16px;
    color: #dc3545;
    margin-bottom: 15px;
    line-height: 1.5;
}

.upload-record-info {
    margin: 15px 0;
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.upload-record-info div {
    margin-bottom: 8px;
}

.upload-record-info div:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for upload modal */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: row;
        width: 100%;
        gap: 8px;
    }
    
    .new-record-btn, .upload-btn {
        flex: 1;
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .upload-modal {
        width: 95vw;
        max-width: none;
    }
}

/* New Upload Modal Styles */
.drag-drop-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.drag-drop-area:hover,
.drag-drop-area.drag-over {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-icon {
    font-size: 48px;
    color: #bbb;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.drag-drop-area:hover .upload-icon,
.drag-drop-area.drag-over .upload-icon {
    color: #667eea;
}

.upload-text .primary-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.upload-text .secondary-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.upload-text .supported-formats {
    font-size: 12px;
    color: #999;
}

.hotwords-section {
    margin-bottom: 20px;
}

.hotwords-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.hotwords-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

.hotwords-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.hotwords-help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.processing-controls,
.completion-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.btn-secondary.small {
    padding: 8px 12px;
    font-size: 12px;
    height: auto;
}

.upload-initial,
.upload-progress,
.upload-uploaded,
.upload-processing,
.upload-complete,
.upload-error {
    padding: 20px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-info i {
    font-size: 24px;
    color: #667eea;
    flex-shrink: 0;
}

.upload-progress .file-info {
    margin-bottom: 20px;
}

.file-upload-progress {
    margin-bottom: 20px;
}

.file-upload-progress .file-info {
    margin-bottom: 15px;
}

.upload-success-indicator {
    color: #28a745;
    font-size: 20px;
}

.upload-complete-info {
    text-align: center;
    margin-bottom: 15px;
}

.upload-status {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.upload-details {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
}

.upload-details span {
    flex: 1;
}

@media (max-width: 768px) {
    .upload-details {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .drag-drop-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
}

/* Recording Information Section */
.recording-info-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.recording-info-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.recording-info-grid {
    display: grid;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 14px;
    flex: 1;
}

.hotwords-row {
    align-items: flex-start;
}

.hotwords-container {
    flex: 1;
}

.hotwords-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hotwords-value {
    white-space: pre-wrap;
    word-break: break-word;
}

.edit-hotwords-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s;
}

.edit-hotwords-btn:hover {
    background: #e3f2fd;
}

.hotwords-edit {
    width: 100%;
}

.hotwords-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    margin-bottom: 8px;
}

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

.save-hotwords-btn, .cancel-hotwords-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.save-hotwords-btn {
    background: #28a745;
    color: white;
}

.save-hotwords-btn:hover {
    background: #218838;
}

.cancel-hotwords-btn {
    background: #6c757d;
    color: white;
}

.cancel-hotwords-btn:hover {
    background: #5a6268;
}

/* Adjust transcript text to flow after Recording Information */
.tab-pane .transcript-text {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .recording-info-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .info-label {
        min-width: auto;
        font-weight: 600;
    }
    
    .hotwords-actions {
        flex-direction: column;
    }
    
    .save-hotwords-btn, .cancel-hotwords-btn {
        width: 100%;
    }
    
    .upload-text .primary-text {
        font-size: 16px;
    }
    
    .processing-controls,
    .completion-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* Summary Tab Styles */

/* Markdown Content Styles */
.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.4;
    color: #333;
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin: 10px 0;
    max-height: 500px;
    overflow-y: auto;
}

.markdown-content h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0 6px 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.markdown-content h1:first-child {
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0 4px 0;
    color: #333;
}

.markdown-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0 3px 0;
    color: #333;
}

.markdown-content p {
    margin: 4px 0;
    color: #333;
}

.markdown-content ul {
    margin: 4px 0;
    padding-left: 16px;
}

.markdown-content li {
    margin: 2px 0;
    list-style-type: disc;
    color: #333;
}

.markdown-content strong {
    font-weight: 600;
    color: #333;
}

.markdown-content em {
    font-style: italic;
    color: #666;
}

.markdown-content code {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    color: #333;
}

.markdown-content pre {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
}

.markdown-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #333;
}

/* Summary loading and error states */
.summary-content .placeholder-content {
    text-align: center;
    padding: 40px 20px;
}

.summary-content .placeholder-content i {
    font-size: 48px;
    color: var(--secondary-text-color);
    margin-bottom: 20px;
}

.summary-content .placeholder-content h3 {
    margin: 15px 0 10px 0;
    color: var(--text-color);
}

.summary-content .placeholder-content p {
    color: var(--secondary-text-color);
    margin: 0;
}

/* Auto-scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.scroll-indicator:hover {
    background: rgba(0, 123, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.scroll-indicator i {
    animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.transcript-display {
    position: relative; /* For absolute positioning of scroll indicator */
}

/* Dark mode adjustments for markdown */
