/* DaisyUI Light Theme Integration */
:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #0ea5e9;
    --accent-hover: #0284c7;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 100px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.logo i {
    font-size: 1.4rem;
    color: var(--accent-color);
}

.logo img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
}

/* Views */
.view {
    flex: 1;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* Onboarding View */
#onboarding-view {
    justify-content: flex-start;
    align-items: center;
    padding: 5px 20px 40px 20px;
}

.onboarding-card {
    background: var(--card-bg);
    padding: 60px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.action-btn {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.action-btn:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
}

.icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.action-btn span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.action-btn .sub-text {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Recording Interface */
#recording-interface {
    margin-top: 30px;
    flex-direction: column;
    align-items: center;
}

#recording-interface:not(.hidden) {
    display: flex;
}

/* Recording Prompt Card */
.recording-prompt-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-md);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Desktop: Recording controls horizontal layout */
.recording-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 12px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.recording-prompt-card .primary-btn {
    padding: 12px 32px;
    white-space: nowrap;
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.prompt-header i {
    font-size: 1.2rem;
}

.prompt-text {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.hidden {
    display: none !important;
}

.view.hidden {
    display: none;
    opacity: 0;
}

.recording-visualizer {
    display: flex;
    gap: 6px;
    height: 40px;
    align-items: center;
}

.bar {
    width: 6px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 10px;
    animation: wave 1s infinite ease-in-out;
}

.bar:nth-child(2) {
    animation-delay: 0.1s;
}

.bar:nth-child(3) {
    animation-delay: 0.2s;
}

.bar:nth-child(4) {
    animation-delay: 0.3s;
}

.bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {

    0%,
    100% {
        height: 10px;
        opacity: 0.5;
    }

    50% {
        height: 30px;
        opacity: 1;
    }
}

.timer {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-secondary);
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: var(--accent-hover);
}

.secondary-btn {
    background: var(--bg-color);
    color: var(--text-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.secondary-btn:hover {
    background: #f1f5f9;
}

/* Workspace View */
.workspace-layout {
    display: flex;
    gap: 30px;
    width: 100%;
    padding: 20px 0;
}

.input-panel,
.output-panel {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.output-panel {
    display: flex;
    opacity: 1;
}

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

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.voice-badge {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-editor-container {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
    background: var(--bg-color);
}

.text-editor-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

#tts-input {
    flex: 1;
    border: none;
    resize: none;
    font-family: var(--font-family);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    outline: none;
    background: transparent;
}

#tts-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.tags {
    display: flex;
    gap: 8px;
}

.tag {
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}

.tag:hover {
    background: #cbd5e1;
    color: var(--text-primary);
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.large-btn {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Output Panel - Audio Cards */
.clips-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
}

/* Audio Card */
/* Apple Music Style Player */
.audio-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px;
}

.audio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.15);
    background: rgba(255, 255, 255, 1);
    border-color: var(--accent-color);
}

.player-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.album-art {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.25);
    flex-shrink: 0;
}

.track-info {
    flex: 1;
    min-width: 0;
    /* For truncation to work */
}

.track-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.play-pause {
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.control-btn.play-pause:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
}

.control-btn.play-pause:active {
    transform: scale(0.95);
}

.control-btn.download-btn {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    transition: all 0.2s;
}

.control-btn.download-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.control-btn.download-btn:active {
    transform: scale(0.95);
}

.control-btn.delete-btn {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 50%;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.delete-btn:hover {
    background: #ff3b30;
    color: white;
    transform: scale(1.05);
}

.control-btn.delete-btn:active {
    transform: scale(0.95);
}

/* Visualization */
.player-visualization {
    height: 48px;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 16px;
    overflow: hidden;
}

.viz-bar {
    width: 4px;
    background: var(--text-secondary);
    border-radius: 4px;
    height: 8px;
    transition: height 0.2s ease, background-color 0.3s;
    opacity: 0.3;
}

.audio-card.playing .viz-bar {
    animation: visualize 0.6s infinite ease-in-out alternate;
    opacity: 1;
    background: var(--accent-color);
}

@keyframes visualize {
    0% {
        height: 8px;
    }

    100% {
        height: 32px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Scrollbar for clips list */
.clips-list::-webkit-scrollbar {
    width: 6px;
}

.clips-list::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.5);
    border-radius: 3px;
}

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

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

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.25s ease-out;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content */
.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content.large-modal {
    max-width: 700px;
}

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

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.5rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

/* Modal Body */
.modal-body {
    padding: 30px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

/* Name Recording Modal Styles */
.name-modal {
    max-width: 450px;
    animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.name-modal .modal-body {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: visible;
    max-height: none;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.modal-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Modal Input Groups */
.modal-input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-color);
    color: var(--text-primary);
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.modal-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Modal Transcript Container - Match main text editor */
.modal-transcript-container {
    margin-top: 0;
    padding: 16px;
    min-height: 150px;
}

.modal-transcript-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    background: transparent;
}

.modal-transcript-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

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

.modal-actions .secondary-btn,
.modal-actions .primary-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.modal-actions .secondary-btn {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-actions .secondary-btn:hover {
    background: #f1f5f9;
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.modal-actions .secondary-btn:active {
    transform: translateY(0);
}

.modal-actions .primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-actions .primary-btn i {
    font-size: 1.1rem;
}

.modal-actions .primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.modal-actions .primary-btn:active {
    transform: translateY(0);
}

/* Saved Voices Grid */
.saved-voices-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voice-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.voice-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.voice-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
}

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

.voice-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.icon-btn {
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.icon-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.icon-btn.delete-btn:hover {
    background: #ff3b30;
    border-color: #ff3b30;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-card {
    background: var(--card-bg);
    padding: 40px 60px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
}

.loading-visualizer {
    margin-bottom: 0;
}

.loading-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Empty State in Modal */
.modal-body .empty-state {
    padding: 40px 20px;
    text-align: center;
}

.modal-body .empty-state i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 16px;
}

.modal-body .empty-state p {
    color: var(--text-secondary);
    margin: 8px 0;
}

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

    /* Navbar */
    .navbar {
        padding: 12px 20px;
        margin-bottom: 5px;
    }

    .logo {
        font-size: 1rem;
    }

    .logo img {
        height: 24px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    /* Onboarding View */
    #onboarding-view {
        padding: 0px 12px 20px 12px;
    }

    .onboarding-card {
        padding: 24px 20px;
        max-width: 100%;
        margin-top: 0;
    }

    .header-text h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .header-text p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    /* Stack buttons vertically on mobile */
    .action-buttons {
        flex-direction: column;
        gap: 16px;
    }

    .action-btn {
        width: 100%;
        padding: 24px 20px;
    }

    .icon-circle {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .action-btn span {
        font-size: 0.95rem;
    }

    .action-btn .sub-text {
        font-size: 0.8rem;
    }

    /* Workspace View - Stack panels vertically */
    .workspace-layout {
        flex-direction: column;
        gap: 20px;
        padding: 20px 0;
    }

    .input-panel,
    .output-panel {
        padding: 24px;
        min-height: auto;
    }

    .input-panel {
        min-height: 400px;
    }

    .panel-header {
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .panel-header h2 {
        font-size: 1.3rem;
    }

    .voice-badge {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    #tts-input {
        font-size: 1rem;
    }

    .editor-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tags {
        flex-wrap: wrap;
    }

    .char-count {
        align-self: flex-end;
    }

    .large-btn {
        padding: 14px;
        font-size: 1rem;
    }

    /* Audio Cards */
    .audio-card {
        padding: 20px;
    }

    .album-art {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .track-title {
        font-size: 0.95rem;
    }

    .track-artist {
        font-size: 0.85rem;
    }

    .control-btn.play-pause {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .control-btn.download-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .player-visualization {
        height: 40px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 95%;
    }

    .modal-content.large-modal {
        max-width: 95%;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 20px;
    }

    .name-modal .modal-body {
        padding: 30px 24px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-description {
        font-size: 0.9rem;
    }

    .modal-input {
        font-size: 1rem;
        padding: 14px 16px;
    }

    .modal-transcript-container {
        padding: 14px;
        min-height: 120px;
    }

    .modal-transcript-textarea {
        font-size: 1rem;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .modal-actions .secondary-btn,
    .modal-actions .primary-btn {
        width: 100%;
        padding: 14px 18px;
    }

    /* Voice Items */
    .voice-item {
        padding: 14px;
    }

    .voice-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .voice-name {
        font-size: 0.95rem;
    }

    .voice-date {
        font-size: 0.8rem;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    /* Primary buttons */
    .primary-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    /* Recording Interface */
    #recording-interface {
        margin-top: 24px;
    }

    .recording-prompt-card {
        padding: 20px;
        max-width: 100%;
        gap: 16px;
    }

    /* Mobile: Stack recording controls vertically */
    .recording-controls {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .recording-status {
        flex-direction: column;
        gap: 10px;
    }

    .recording-prompt-card .primary-btn {
        width: 100%;
        padding: 12px 24px;
    }

    .prompt-header {
        font-size: 0.9rem;
    }

    .prompt-header i {
        font-size: 1.1rem;
    }

    .prompt-text {
        padding: 16px;
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .recording-visualizer {
        gap: 5px;
        height: 36px;
    }

    .bar {
        width: 5px;
    }

    .timer {
        font-size: 0.95rem;
    }

    /* Loading Overlay */
    .loading-card {
        padding: 30px;
        margin: 0 20px;
        max-width: calc(100% - 40px);
    }

    .loading-text {
        font-size: 1rem;
    }


    /* Error Toast */
    #error-toast {
        bottom: 20px;
        padding: 14px 20px;
        font-size: 0.9rem;
        width: calc(100% - 40px);
        left: 20px;
        transform: none;
    }

    /* Clips List */
    .clips-list {
        padding-right: 4px;
    }

    .empty-state i {
        font-size: 2.5rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media screen and (max-width: 480px) {
    .app-container {
        padding: 8px;
    }

    .navbar {
        padding: 10px 16px;
    }

    .logo {
        font-size: 0.9rem;
    }

    #onboarding-view {
        padding: 0px 8px 15px 8px;
    }

    .onboarding-card {
        padding: 20px 16px;
        margin-top: 0;
    }

    .header-text h1 {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .header-text p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .input-panel,
    .output-panel {
        padding: 20px;
    }

    .panel-header h2 {
        font-size: 1.2rem;
    }

    .audio-card {
        padding: 16px;
        gap: 16px;
    }

    .player-top {
        gap: 12px;
    }

    /* Recording prompt for very small screens */
    .recording-prompt-card {
        padding: 16px;
        gap: 14px;
    }

    .recording-controls {
        padding: 14px;
        gap: 10px;
    }

    .recording-status {
        gap: 8px;
    }

    .prompt-header {
        font-size: 0.85rem;
    }

    .prompt-text {
        padding: 14px;
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .recording-prompt-card .primary-btn {
        padding: 12px 20px;
    }
}