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

/* === Signing Overlay === */
.signing-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #0f0f10;
  color: #cfcfff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.5s ease;
}

/* Animated Dots Loader */
.dots-loader {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.dots-loader .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #a991ff;
  animation: pulse 1s infinite ease-in-out;
}

.dots-loader .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dots-loader .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Signing text */
.signing-text {
  font-size: 16px;
  color: #ccc;
}


/* ===============================
          Main UI Components
   =============================== */
html, body {
    height: 100%;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #d9d0ff 100%);
    overflow: hidden;
}

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

/* Authentication Bar - Minimal and Modern */
.auth-bar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-status {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0078d4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.auth-loading {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 120, 212, 0.2);
    border-top: 2px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.sign-in-btn {
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sign-in-btn:hover {
    background: #106ebe;
    transform: translateY(-1px);
}

/* Main Recording Interface */
.recording-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Timer Display */
.timer-display {
    font-size: 48px;
    font-weight: bold;
    color: #6b7280;
    font-family: 'Segoe UI', monospace;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Controls Container */
.controls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

/* Button Base Styles */
.control-btn {
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.control-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Record Button - Large Circle */
.record-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    font-size: 36px;
    border: 6px solid rgba(255, 255, 255, 0.3);
}

.record-btn.recording {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

/* Secondary Buttons - Perfect Squares */
.secondary-btn {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    font-size: 20px;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.secondary-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Play Button - Special Circle */
.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #059669;
    font-size: 24px;
}

/* Status Text */
.status-text {
    font-size: 16px;
    color: #4b5563;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
}

/* Progress Bar for Playback */
.progress-container {
    width: 100%;
    max-width: 400px;
    margin: 20px 0;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: #059669;
    border-radius: 3px;
    transition: width 0.1s ease;
}

.progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Filename Input and Save Controls */
.save-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

.filename-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.filename-input:focus {
    border-color: #059669;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.save-btn {
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    width: 100%;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(195, 255, 101, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* .loading-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
} */

/* Mobile Optimizations */
@media (max-width: 768px) {
    .timer-display {
        font-size: 36px;
        margin-bottom: 30px;
    }
    
    .record-btn {
        width: 100px;
        height: 100px;
        font-size: 32px;
    }
    
    .secondary-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .play-btn {
        width: 70px;
        height: 70px;
        font-size: 20px;
    }
    
    .controls-container {
        gap: 15px;
    }
    
    .save-controls {
        max-width: 320px;
        gap: 10px;
    }
    
    .filename-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 14px;
    }
    
    .save-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .timer-display {
        font-size: 32px;
        margin-bottom: 25px;
    }
    
    .record-btn {
        width: 90px;
        height: 90px;
        font-size: 28px;
    }
    
    .secondary-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .play-btn {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
    
    .controls-container {
        gap: 12px;
    }
}

/* Hide elements initially */
.hidden {
    display: none !important;
}

/* Fade animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Tab Navigation - Mobile First */
.tab-navigation {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 100;
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-button {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: auto;
}

.tab-button.active {
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button:hover:not(.active) {
    background: rgba(123, 104, 238, 0.3);
    color: #374151;
}

/* Tab Content Areas */
.tab-content {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* Mobile Optimizations for Tabs */
@media (max-width: 768px) {
    .tab-navigation {
        left: 12px;
        transform: none;
        top: 8px;
        right: auto;
    }
    
    .auth-bar {
        top: 12px;
        right: 12px;
        left: auto;
    }
    
    .tab-button {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .tab-navigation {
        top: 6px;
        left: 8px;
    }
    
    .auth-bar {
        top: 8px;
        right: 8px;
    }
    
    .tab-button {
        padding: 5px 10px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .auth-status {
        padding: 3px 10px;
        font-size: 11px;
    }
    
    .auth-avatar {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .sign-in-btn {
        padding: 3px 10px;
        font-size: 10px;
    }
}

/* Transcription Interface - Mobile First */
.transcription-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    overflow-y: auto;
}

/* Transcription Header */
.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.transcription-title {
    font-size: 24px;
    font-weight: bold;
    color: #374151;
    margin: 0;
}

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

.refresh-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #374151;
    transform: rotate(90deg);
}

.new-transcription-btn {
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    white-space: nowrap;
}

.new-transcription-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

/* Empty State */
.transcription-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state-illustration {
    width: 200px;
    height: 150px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(195, 255, 101, 0.1) 0%, rgba(168, 232, 80, 0.1) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 16px;
    line-height: 1.5;
    max-width: 320px;
    margin-bottom: 24px;
}

/* Transcription List - Mobile-First Cards */
.transcription-list {
    display: none; /* Hidden when empty */
    flex-direction: column;
    gap: 12px;
}

.transcription-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.transcription-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.card-menu {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.card-menu:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.card-detail {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-transcribing {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.status-ready {
    background: rgba(123, 104, 238, 0.1);
    color: #6c5ce7;
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-processing {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

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

.action-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: #d1d5db;
    background: rgba(107, 114, 128, 0.05);
}

.action-btn.primary {
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: white;
    border-color: transparent;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #6c5ce7 0%, #5d51d8 100%);
}

.action-btn.danger {
    color: #dc2626;
    border-color: #fecaca;
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: #f87171;
}

/* Desktop Optimizations */
@media (min-width: 769px) {
    .transcription-interface {
        padding: 80px 40px 40px;
    }
    
    .transcription-title {
        font-size: 28px;
    }
    
    .new-transcription-btn {
        font-size: 16px;
        padding: 12px 24px;
    }
    
    .empty-state-illustration {
        width: 300px;
        height: 200px;
        font-size: 80px;
    }
    
    .empty-state-title {
        font-size: 24px;
    }
    
    .empty-state-description {
        font-size: 18px;
        max-width: 500px;
    }
    
    /* Convert to table layout on desktop */
    .transcription-list.desktop-table {
        display: table;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 8px;
    }
    
    .transcription-card.desktop-row {
        display: table-row;
    }
    
    .transcription-card.desktop-row > div {
        display: table-cell;
        vertical-align: middle;
        padding: 16px;
        border: none;
    }
}

/* Mobile Specific Adjustments */
@media (max-width: 768px) {
    .transcription-interface {
        padding: 70px 16px 16px;
    }
    
    .transcription-header {
        margin-bottom: 20px;
    }
    
    .transcription-title {
        font-size: 20px;
    }
    
    .new-transcription-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .empty-state-illustration {
        width: 150px;
        height: 120px;
        font-size: 48px;
        margin-bottom: 20px;
    }
    
    .empty-state-title {
        font-size: 18px;
    }
    
    .empty-state-description {
        font-size: 14px;
    }
    
    .transcription-card {
        padding: 14px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-details {
        font-size: 12px;
    }
}

/* Generic Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* Styling for saving overlay */
.saving-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #7b68ee;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.saving-message {
    color: white;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    line-height: 1.5;
    background-color: rgba(108, 92, 231, 0.8);
    padding: 15px 20px;
    border-radius: 8px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #374151;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 20px;
}

.button-primary {
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.status-completed {
    background: #7b68ee;
    color: white;
}

.status-badge.status-transcribing {
    background: #3b82f6;
    color: white;
}

.status-badge.status-pending {
    background: #f59e0b;
    color: white;
}

.status-badge.status-failed {
    background: #ef4444;
    color: white;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

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

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .pagination-buttons {
        justify-content: center;
    }
}

/* OneDrive File Browser Modal - Mobile First */
.file-browser-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.file-browser-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.file-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
}

.file-browser-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.file-browser-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.file-browser-close:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.file-search-container {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.file-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: #f9fafb;
    color: #374151;
    outline: none;
    transition: all 0.3s ease;
}

.file-search-input:focus {
    border-color: #7b68ee;
    background: white;
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
}

.file-browser-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.file-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 0;
    font-size: 13px;
    color: #6b7280;
}

.breadcrumb-item {
    cursor: pointer;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #059669;
}

.breadcrumb-separator {
    color: #d1d5db;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

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

.file-item:hover {
    background: rgba(123, 104, 238, 0.05);
}

.file-item.selected {
    background: rgba(123, 104, 238, 0.1);
    border-left: 3px solid #7b68ee;
}

.file-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(123, 104, 238, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: #6c5ce7;
}

.file-details {
    flex: 1;
    min-width: 0;
    margin-right: 12px;
}

.file-name {
    font-size: 14px;
    font-weight: 400;
    color: #374151;
    word-break: break-word;
    line-height: 1.4;
}

.file-date {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    margin-right: 12px;
}

.file-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-checkbox.checked {
    background: #059669;
    border-color: #059669;
}

.file-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.file-browser-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.selected-file-info {
    flex: 1;
    min-width: 0;
}

.selected-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
    word-break: break-word;
}

.selected-file-details {
    font-size: 12px;
    color: #6b7280;
}

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

.file-browser-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-browser-btn.secondary {
    background: #e5e7eb;
    color: #6b7280;
}

.file-browser-btn.secondary:hover {
    background: #d1d5db;
    color: #374151;
}

.file-browser-btn.primary {
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.3);
}

.file-browser-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

.file-browser-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.file-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
}

.file-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

.file-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

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

.file-empty-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.file-empty-description {
    font-size: 14px;
    line-height: 1.4;
}

/* Mobile Optimizations for File Browser */
@media (max-width: 768px) {
    .file-browser-modal {
        padding: 10px;
        align-items: flex-end;
    }
    
    .file-browser-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
    }
    
    .file-browser-header {
        padding: 16px 20px;
    }
    
    .file-browser-title {
        font-size: 16px;
    }
    
    .file-search-container {
        padding: 12px 16px;
    }
    
    .file-browser-body {
        padding: 12px 16px;
    }
    
    .file-browser-footer {
        padding: 16px;
    }
    
    .file-item {
        padding: 10px 12px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .file-meta {
        font-size: 11px;
    }
    
    .file-browser-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* New Transcription Form Modal - Mobile First */
.transcription-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.transcription-form-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.transcription-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #7b68ee 0%, #6c5ce7 100%);
}

.transcription-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.transcription-form-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.transcription-form-close:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.transcription-form-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.selected-file-display {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-display-icon {
    font-size: 24px;
    color: #059669;
}

.file-display-details {
    flex: 1;
    min-width: 0;
}

.file-display-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
    word-break: break-word;
}

.file-display-meta {
    font-size: 12px;
    color: #6b7280;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px; /* Prevent iOS zoom */
    background: #f9fafb;
    color: #374151;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #a8e850;
    background: white;
    box-shadow: 0 0 0 3px rgba(168, 232, 80, 0.1);
}

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

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: #a8e850;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 14px;
    color: #374151;
    user-select: none;
    cursor: pointer;
}

.form-number-input {
    width: 80px;
}

.form-disclaimer {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

.transcription-form-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.transcription-form-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.transcription-form-btn.secondary {
    background: #e5e7eb;
    color: #6b7280;
}

.transcription-form-btn.secondary:hover {
    background: #d1d5db;
    color: #374151;
}

.transcription-form-btn.primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.transcription-form-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

.transcription-form-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Mobile Optimizations for Transcription Form */
@media (max-width: 768px) {
    .transcription-form-modal {
        padding: 10px;
        align-items: flex-end;
    }
    
    .transcription-form-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
    }
    
    .transcription-form-header {
        padding: 16px 20px;
    }
    
    .transcription-form-title {
        font-size: 16px;
    }
    
    .transcription-form-body {
        padding: 16px 20px;
    }
    
    .transcription-form-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .transcription-form-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .form-input {
        font-size: 16px; /* Prevent iOS zoom */
    }
}


/* Disclaimer Box Style */
.recording-disclaimer {
    display: none; /* hidden by default */
    background: #e8f1ff;
    color: #084298;
    padding: 10px 14px;
    margin: 10px 0 15px 0;
    border: 1px solid #b6d4fe;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

/* ===============================
   Confirm Re-Record Modal Box
   =============================== */

/* Modal overlay */
.mv-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Modal box */
.mv-modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.mv-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.mv-modal-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
}

.mv-modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.mv-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.mv-btn.secondary {
    background: #e5e7eb;
}

.mv-btn.primary {
    background: #2563eb;
    color: white;
}


/* ===============================
   Auth User Display Component
   =============================== */

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e6e0ff; /* same light purple as your Transcribe button */
  border-radius: 9999px;
  padding: 6px 14px;
  transition: background 0.2s ease, transform 0.15s ease;
  cursor: default;
}

.auth-pill:hover {
  background: #d3c7ff; /* slightly deeper on hover */
  transform: translateY(-1px);
}

.auth-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7055f8, #8b74ff);
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.auth-name {
  color: #1b1b1b;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  user-select: none;
}
