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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Header */
.header {
    background: linear-gradient(135deg, #F9A704 0%, #F2C96F 100%);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #F9A704 0%, #F2C96F 50%, #CEE6EC 100%);
    opacity: 0.9;
    z-index: 1;
}

.header > * {
    position: relative;
    z-index: 2;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(249, 167, 4, 0.3));
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.header h2 {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    margin: 0;
}

.logout-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    padding: 2rem 1.5rem;
}

/* Voice Recorder */
.voice-recorder {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.recorder-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    text-align: center;
}

.recorder-instruction {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #64748b;
    max-width: 400px;
    line-height: 1.4;
    opacity: 0.8;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.status-indicator.recording {
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

.status-indicator.processing {
    background: #f59e0b;
    animation: spin 1s linear infinite;
}

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

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

.status-text {
    font-size: 1rem;
    font-weight: 500;
    color: #64748b;
}

/* Recorder Controls */
.recorder-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.record-btn, .stop-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1.5rem;
    border: none;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.record-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

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

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

.stop-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3);
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107, 114, 128, 0.4);
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Recording Timer */
.recording-timer {
    text-align: center;
    margin-bottom: 1.5rem;
    display: none;
}

.recording-timer.visible {
    display: block;
}

.timer-text {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Courier New', monospace;
}

/* Waveform Container */
.waveform-container {
    display: none;
    justify-content: center;
    margin-bottom: 1rem;
}

.waveform-container.visible {
    display: flex;
}

#waveformCanvas {
    border-radius: 8px;
    background: #f8fafc;
}

/* Recordings Section */
.recordings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.archive-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.archive-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 0.5rem;
    padding: 0.5rem;
}

.recordings-list::-webkit-scrollbar {
    width: 8px;
}

.recordings-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.recordings-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.recordings-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.no-recordings {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    margin: 1rem 0;
}

.no-recordings p:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #475569;
}

.no-recordings p:last-child {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #64748b;
}

.recording-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    min-height: auto;
    position: relative;
    overflow: hidden;
}

.recording-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 0 2px 2px 0;
}

.recording-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.recording-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    font-size: 1.2rem;
}

.recording-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 0.125rem 0;
}

.recording-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.recording-date {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.2;
}

.recording-duration {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 45px;
    text-align: center;
}

.cloud-indicator {
    font-size: 0.8rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.recording-transcript,
.recording-summary {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.recording-transcript {
    color: #3b82f6;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.recording-summary {
    color: #10b981;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
}

/* Recording Actions */
.recording-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.protocol-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.protocol-btn:hover {
    background: #2563eb;
}

/* Post-Recording Actions */
.post-recording-actions {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    overflow: hidden;
}

.post-recording-actions.visible {
    opacity: 1;
    transform: translateY(0);
}

.post-recording-actions h4 {
    text-align: center;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    text-align: left;
    min-height: 60px;
    max-width: 100%;
    box-sizing: border-box;
}

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

.action-btn.primary {
    background: linear-gradient(135deg, #F9A704 0%, #F2C96F 100%);
    color: white;
    border-color: #F9A704;
}

.action-btn.primary:hover {
    box-shadow: 0 8px 24px rgba(249, 167, 4, 0.4);
}

.action-btn.secondary {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.action-btn.secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

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

.action-btn.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.2);
}

.action-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.action-btn span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-wrap: break-word;
}

/* Post-Recording Actions Mobile */
@media (max-width: 768px) {
    .post-recording-actions {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }
    
    .action-btn {
        padding: 0.875rem 1.25rem;
        min-height: 50px;
        max-width: 100%;
        font-size: 0.9rem;
    }
    
    .action-btn span {
        font-size: 0.9rem;
    }
    
    .view-more-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.footer-links a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.footer-links .separator {
    color: #94a3b8;
    font-weight: 300;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #f1f5f9;
    color: #334155;
}

.modal-body {
    padding: 1.5rem;
}

/* Protocol Modal Specific Styles */
.protocol-modal {
    max-width: 90vw !important;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Archive Modal Specific Styles */
.archive-modal {
    max-width: 95vw !important;
    max-height: 90vh;
    width: 90vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.archive-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.filter-controls select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #475569;
    cursor: pointer;
}

.archive-recordings-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 1rem;
}

.archive-recordings-list .recording-item {
    margin-bottom: 0.75rem;
}

.view-more-recordings {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
}

.view-more-btn {
    background: linear-gradient(135deg, #F9A704 0%, #F2C96F 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(249, 167, 4, 0.3);
}

.view-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 167, 4, 0.4);
}

.protocol-content {
    line-height: 1.6;
    color: #374151;
    font-size: 14px;
    overflow-y: auto;
    padding: 0 1rem;
    max-height: 60vh;
}

/* Protocol Content Styling */
.protocol-header {
    margin-bottom: 1.5rem;
}

.protocol-header h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1e293b;
    text-align: center;
}

.protocol-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.meta-item {
    font-size: 0.9rem;
    color: #475569;
}

.protocol-status {
    text-align: center;
    padding: 0.75rem;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 0.9rem;
}

.protocol-section {
    margin-bottom: 1.5rem;
}

.protocol-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.protocol-content-text {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
    white-space: pre-wrap;
}

.protocol-footer {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

.protocol-content h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.protocol-content h2 {
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem 0;
    color: #334155;
}

.protocol-content p {
    margin-bottom: 0.5rem;
}

.protocol-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.protocol-content li {
    margin-bottom: 0.25rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.modal-actions .action-btn {
    padding: 0.75rem 1.5rem;
    min-height: auto;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .voice-recorder {
        padding: 2rem 1.5rem;
    }
    
    .recorder-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .record-btn, .stop-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Post-Recording Actions Mobile */
    .post-recording-actions {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .action-btn {
        padding: 0.875rem 1.25rem;
        min-height: 50px;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    /* Protocol Modal Mobile */
    .protocol-modal {
        max-width: 95vw !important;
        max-height: 95vh;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    /* Archive Modal Mobile */
    .archive-modal {
        max-width: 98vw !important;
        width: 95vw;
        margin: 0.25rem;
    }
    
    .archive-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .protocol-content {
        font-size: 13px;
        padding: 0 0.75rem;
        max-height: 50vh;
    }
    
    .protocol-content h1 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .protocol-content h2 {
        font-size: 1.1rem;
        margin: 0.75rem 0 0.5rem 0;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .modal-actions .action-btn {
        width: 100%;
        padding: 0.875rem 1rem;
        justify-content: center;
    }
}

/* Desktop Styles */
@media (min-width: 769px) {
    .app-container {
        padding: 0 2rem;
    }
    
    .header {
        padding: 3rem 2rem 2rem;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header h2 {
        font-size: 1.3rem;
    }
    
    .logo {
        width: 100px;
        height: 100px;
    }
    
    .main-content {
        padding: 3rem 2rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: start;
    }
    
    .voice-recorder {
        padding: 2.5rem;
        margin-bottom: 0;
    }
    
    /* Recordings Button Section */
    .recordings-button-section {
        text-align: center;
        margin: 2rem 0;
        padding: 0 2rem;
    }
    
    .show-recordings-btn {
        background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
        color: white;
        border: none;
        border-radius: 16px;
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.875rem;
        margin: 0 auto;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
        min-width: 280px;
        position: relative;
        overflow: hidden;
    }
    
    .show-recordings-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    .show-recordings-btn:hover::before {
        left: 100%;
    }
    
    .show-recordings-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.35);
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    }
    
    .show-recordings-btn:active {
        transform: translateY(-1px);
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    }
    
    .show-recordings-btn svg {
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .show-recordings-btn:hover svg {
        transform: translateX(3px);
    }
    
    /* Recordings Modal Styles */
    .recordings-modal {
        max-width: 800px;
        max-height: 80vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .recordings-modal .modal-body {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .recordings-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
        border-bottom: 2px solid #f1f5f9;
        gap: 1rem;
        flex-shrink: 0;
    }
    
    .recordings-controls .search-box {
        flex: 1;
        max-width: 400px;
        position: relative;
    }
    
    .recordings-controls .search-box input {
        width: 100%;
        padding: 1rem 1rem 1rem 3rem;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        font-size: 1rem;
        background: white;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .recordings-controls .search-box input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    }
    
    .recordings-controls .search-box svg {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        width: 20px;
        height: 20px;
    }
    
    .recordings-controls .filter-controls {
        flex-shrink: 0;
    }
    
    /* Mobile styles for recordings button */
    @media (max-width: 768px) {
        .recordings-button-section {
            margin: 1.5rem 0;
            padding: 0 1rem;
        }
        
        .show-recordings-btn {
            width: 100%;
            max-width: 320px;
            padding: 1.5rem 2rem;
            font-size: 1.2rem;
            min-width: auto;
            border-radius: 20px;
        }
        
        .show-recordings-btn svg {
            width: 22px;
            height: 22px;
        }
        
        .recordings-modal {
            max-width: 95%;
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        
        .recordings-modal .modal-body {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        
        .recordings-controls {
            flex-shrink: 0;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        
        .recordings-controls .search-box {
            min-width: 200px;
            flex: 1;
        }
        
        .recordings-list {
            flex: 1;
            overflow-y: auto;
            padding-right: 0.5rem;
            margin-right: -0.5rem;
        }
        
        .recording-item {
            padding: 0.625rem;
            gap: 0.5rem;
            min-height: auto;
            border-radius: 10px;
        }
        
        .recording-info {
            min-width: 0;
            flex: 1;
            overflow: hidden;
            padding: 0.125rem 0;
        }
        
        .recording-name {
            font-size: 0.8rem;
            white-space: nowrap;
            line-height: 1.2;
            margin-bottom: 0.25rem;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .recording-date {
            font-size: 0.7rem;
            line-height: 1.1;
        }
        
        .recording-duration {
            font-size: 0.65rem;
            padding: 0.2rem 0.4rem;
            min-width: 40px;
        }
        
        .recording-transcript,
        .recording-summary {
            font-size: 0.65rem;
            margin-top: 0.2rem;
        }
        
        .cloud-indicator {
            font-size: 0.7rem;
        }
        
        .protocol-btn {
            padding: 0.2rem 0.4rem;
            font-size: 0.65rem;
        }
    }
    
    .recordings-section h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .recorder-controls {
        gap: 2rem;
    }
    
    .record-btn, .stop-btn {
        min-width: 150px;
        padding: 2rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    
    .post-recording-actions {
        padding: 2.5rem;
        margin-top: 2rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .action-btn {
        padding: 1.25rem 2rem;
        min-height: 70px;
        font-size: 1rem;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .recording-item {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .recording-icon {
        width: 50px;
        height: 50px;
    }
    
    .recording-name {
        font-size: 1.1rem;
    }
    
    .recording-date {
        font-size: 0.9rem;
    }
    
    .recording-duration {
        font-size: 0.9rem;
    }
    
    .protocol-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
        font-size: 1.1rem;
    }
    
    .modal-content {
        max-width: 600px;
    }
    
    .protocol-modal {
        max-width: 800px !important;
    }
    
    .protocol-content {
        font-size: 16px;
        padding: 0 1.5rem;
    }
    
    .protocol-header h1 {
        font-size: 2rem;
    }
    
    .protocol-section h2 {
        font-size: 1.4rem;
    }
    
    .footer {
        padding: 3rem 2rem;
    }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .app-container {
        padding: 0 3rem;
    }
    
    .header {
        padding: 4rem 3rem 3rem;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .header h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        width: 120px;
        height: 120px;
    }
    
    .main-content {
        padding: 4rem 3rem;
        gap: 4rem;
    }
    
    .voice-recorder {
        padding: 3rem;
    }
    
    .recordings-section h3 {
        font-size: 1.75rem;
    }
    
    .recorder-controls {
        gap: 3rem;
    }
    
    .record-btn, .stop-btn {
        min-width: 180px;
        padding: 2.5rem 2rem;
        font-size: 1.1rem;
    }
    
    .btn-icon {
        width: 48px;
        height: 48px;
    }
    
    .post-recording-actions {
        padding: 3rem;
    }
    
    .action-buttons {
        gap: 2rem;
        max-width: 100%;
    }
    
    .action-btn {
        padding: 1.5rem 2.5rem;
        min-height: 80px;
        font-size: 1.1rem;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .recording-item {
        padding: 2rem;
        gap: 2rem;
    }
    
    .recording-icon {
        width: 60px;
        height: 60px;
    }
    
    .recording-name {
        font-size: 1.2rem;
    }
    
    .recording-date {
        font-size: 1rem;
    }
    
    .recording-duration {
        font-size: 1rem;
    }
    
    .protocol-btn {
        min-width: 52px;
        min-height: 52px;
        padding: 1rem;
        font-size: 1.2rem;
    }
    
    .modal-content {
        max-width: 700px;
    }
    
    .protocol-modal {
        max-width: 900px !important;
    }
    
    .protocol-content {
        font-size: 18px;
        padding: 0 2rem;
    }
    
    .protocol-header h1 {
        font-size: 2.5rem;
    }
    
    .protocol-section h2 {
        font-size: 1.6rem;
    }
    
    .footer {
        padding: 4rem 3rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .protocol-modal {
        max-width: 98vw !important;
        margin: 0.25rem;
        width: calc(100% - 0.5rem);
        border-radius: 16px;
    }
    
    .protocol-content {
        font-size: 12px;
        padding: 0 0.5rem;
        max-height: 45vh;
    }
    
    .protocol-content h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .protocol-content h2 {
        font-size: 1rem;
        margin: 0.5rem 0 0.25rem 0;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-actions {
        padding: 0.5rem;
    }
    
    .modal-actions .action-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Post-Recording Actions for Extra Small Mobile */
    .post-recording-actions {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        max-width: 100%;
    }
    
    .action-btn {
        padding: 0.75rem 1rem;
        min-height: 45px;
        font-size: 0.85rem;
        max-width: 100%;
    }
    
    .action-btn span {
        font-size: 0.85rem;
    }
}

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

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

.audio-player {
    text-align: center;
}

.audio-player audio {
    width: 100%;
    margin-bottom: 1rem;
}

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

.recording-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.recording-date {
    font-size: 0.9rem;
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .voice-recorder {
        padding: 1.5rem;
    }
    
    .recorder-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .record-btn, .stop-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .recordings-toggle-section {
        margin: 1rem 0;
        padding: 0 0.5rem;
    }
    
    .toggle-recordings-btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .record-btn, .stop-btn {
        min-height: 60px;
    }
    
    .recording-item {
        min-height: 60px;
    }
    
    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Hover effects for desktop */
@media (hover: hover) and (pointer: fine) {
    .recording-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .action-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    }
    
    .protocol-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(249, 167, 4, 0.4);
    }
    
    .close-btn:hover {
        background: #f1f5f9;
        color: #1e293b;
        transform: scale(1.1);
    }
}
