/* ============================================
   ProScribe AI - Component Styles
   Recording, Settings, Library, Admin
   ============================================ */

/* ===== Recording Workspace ===== */
.recording-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

.recording-panel {
    background: var(--color-bg-primary);
    border: 1.5px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Audio Visualizer */
.audio-visualizer {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    border-radius: 24px;
    background: var(--color-bg-secondary);
    border: 2px dashed var(--color-border-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    position: relative;
    transition: all 0.25s ease;
}

.audio-visualizer.recording {
    border-color: var(--color-blue);
    background: linear-gradient(135deg, var(--color-blue-light) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-style: solid;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.visualizer-icon {
    color: var(--color-text-tertiary);
    transition: all 0.3s;
}

.audio-visualizer.recording .visualizer-icon {
    color: var(--color-blue);
}

.visualizer-waves {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 80px;
}

.wave-bar {
    width: 4px;
    background: var(--color-blue);
    border-radius: var(--radius-full);
    animation: wave 0.8s ease-in-out infinite;
}

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

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

.visualizer-status {
    position: absolute;
    bottom: var(--space-4);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Recording Timer */
.recording-timer {
    text-align: center;
    margin-bottom: var(--space-6);
}

.timer-value {
    font-size: 2.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    color: var(--color-text-primary);
    line-height: 1;
    margin-bottom: var(--space-2);
    font-variant-numeric: tabular-nums;
}

.timer-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.record-btn {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--color-blue);
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.record-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.record-btn:active {
    transform: scale(1.02);
}

.record-btn.recording {
    background: var(--color-red);
}

.record-btn-pulse {
    position: absolute;
    inset: -8px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-blue);
    opacity: 0;
}

.record-btn.recording .record-btn-pulse {
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

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

.control-buttons {
    display: flex;
    gap: var(--space-3);
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-sm);
}

.control-btn.danger {
    color: var(--color-red);
}

.control-btn.danger:hover {
    background: var(--color-red-light);
    border-color: var(--color-red);
}

/* Upload Zone */
.upload-divider {
    width: 100%;
    text-align: center;
    position: relative;
    margin: var(--space-6) 0;
}

.upload-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-border-primary);
}

.upload-divider span {
    position: relative;
    background: var(--color-bg-primary);
    padding: 0 var(--space-4);
    color: var(--color-text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
}

.upload-zone {
    width: 100%;
    padding: 2rem;
    border: 2px dashed var(--color-border-secondary);
    border-radius: var(--radius-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-bg-secondary);
}

.upload-zone:hover {
    border-color: var(--color-blue);
    background: linear-gradient(135deg, var(--color-blue-light) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-style: solid;
}

.upload-icon {
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-4);
}

.upload-zone:hover .upload-icon {
    color: var(--color-blue);
}

.upload-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
    color: var(--color-text-primary);
}

.upload-description {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-2) 0;
    line-height: 1.5;
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin: 0;
}

/* Audio Player Panel */
.audio-player-panel {
    background: var(--color-bg-primary);
    border: 1.5px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border-primary);
}

.player-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.player-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--color-blue-light);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.player-duration {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.player-download {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--color-border-primary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-download:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
    background: var(--color-blue-light);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.player-play-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-blue);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.player-play-btn:hover {
    background: var(--color-blue-hover);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.player-progress {
    flex: 1;
}

.progress-slider {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-border-primary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: var(--space-2);
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--color-blue);
    cursor: pointer;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
}

.player-volume {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.volume-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.volume-btn:hover {
    color: var(--color-text-primary);
}

.volume-slider {
    width: 80px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-border-primary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--color-blue);
    cursor: pointer;
}

/* Transcription Panel */
.transcription-panel {
    grid-column: 1 / -1;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-top: var(--space-6);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border-primary);
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: var(--space-2);
}

.transcription-content {
    min-height: 200px;
    padding: var(--space-5);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.transcription-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border-primary);
    border-top-color: var(--color-blue);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

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

/* ===== Settings Layout ===== */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-8);
}

.settings-sidebar {
    position: sticky;
    top: var(--space-8);
    height: fit-content;
    align-self: flex-start;
}

.settings-nav {
    background: var(--color-bg-primary);
    border: 1.5px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.settings-nav-item:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.settings-nav-item svg {
    flex-shrink: 0;
}

.settings-nav-item.active {
    background: var(--color-blue-light);
    color: var(--color-blue);
    font-weight: 700;
}

.settings-content {
    min-height: 400px;
}

.settings-section {
    background: var(--color-bg-primary);
    border: 1.5px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: var(--space-6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-header-small {
    margin-bottom: var(--space-6);
    padding-bottom: 1.25rem;
    border-bottom: 1.5px solid var(--color-border-primary);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.section-title-small {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--color-text-primary);
}

.section-description-small {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Subscription Card */
.subscription-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--color-border-primary);
}

.subscription-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.subscription-badge {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.status-dot.active {
    background: var(--color-green);
}

.status-dot.inactive {
    background: var(--color-text-tertiary);
}

.subscription-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

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

.detail-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 600;
}

/* Logo Upload */
.logo-upload {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}

.logo-preview {
    width: 112px;
    height: 112px;
    border-radius: 16px;
    border: 2px dashed var(--color-border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    text-align: center;
    color: var(--color-text-tertiary);
}

.logo-placeholder p {
    font-size: 0.75rem;
    margin: var(--space-2) 0 0 0;
}

.logo-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Info Card */
.info-card {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
}

.info-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--color-blue-light);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--space-2) 0;
}

.info-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--color-text-tertiary);
}

.empty-state h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: var(--space-4) 0 var(--space-2) 0;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .recording-workspace {
        grid-template-columns: 1fr;
    }
    
    .settings-layout {
        grid-template-columns: 1fr;
    }
    
    .settings-sidebar {
        position: static;
    }
    
    .settings-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .settings-nav-item {
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .logo-upload {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary-app.full-width {
        width: 100%;
        justify-content: center;
    }
}
