/* File Upload Styles */

.file-upload-section {
    border-radius: 12px;
    padding: 10px;
    visibility: visible !important;
}

.file-upload-label {
    display: block;
    cursor: pointer;
}


.file-upload-box {
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.2s ease;
    background: #ffffff;
}

.file-upload-box:hover {
    border-color: #3B82F6;
}

.file-upload-box.dragging {
    border-color: #3B82F6;
}

/* Dark Theme - File Upload Box */
[data-theme="dark"] .file-upload-box {
    border-color: #4b5563;
    background: rgba(31, 41, 55, 0.5);
}

[data-theme="dark"] .file-upload-box:hover {
    border-color: #3b82f6;
    background: rgba(31, 41, 55, 0.7);
}

[data-theme="dark"] .file-upload-title {
    color: #e5e7eb;
}

[data-theme="dark"] .file-upload-subtitle {
    color: #9ca3af;
}

.file-upload-icon {
    font-size: 48px;
    color: #9CA3AF;
    margin-bottom: 16px;
}

.file-upload-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.file-upload-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 4px 0;
}

.upload-progress-container {
    /* background: white; */
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
}

.upload-progress-header {
    margin-bottom: 8px;
}

.upload-status-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.upload-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #3B82F6;
}

.upload-progress-bar {
    height: 8px;
    border-radius: 4px;
    background: #F3F4F6;
}

.upload-details {
    font-size: 12px;
    color: #6B7280;
}

.lang-btn {
    font-size: 16px !important;
}

code {
    font-size: 12px !important;
}

/* Voice styles chips - container */
.voice-styles-container {
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: linear-gradient(180deg, #FFFFFF, #FAFAFB);
}


.voice-styles-scroll {
    display: inline-flex;
    gap: 10px;
    padding: 10px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    /* iOS momentum scroll */
    overscroll-behavior-x: contain;
    /* prevent parent scroll */
    touch-action: pan-x;
    /* explicitly allow horizontal pan */
    max-width: 100%;
}

.voice-styles-scroll::-webkit-scrollbar {
    display: none;
}

/* Chip */
.voice-style {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.06);
    color: #1F2937;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease, border-color .2s ease;
    flex-shrink: 0;
    user-select: none;
}

.voice-style:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.voice-style:active {
    transform: translateY(0);
}

/* Emoji sizing inside chip (works even if text node) */
.voice-style {
    line-height: 1;
}

.voice-style {
    font-variation-settings: 'wght' 600;
}

/* Mobile improvements: tighter paddings and scroll snap */
@media (max-width: 768px) {
    .voice-styles-container {
        margin-bottom: 8px;
        overflow: visible;
    }

    .voice-styles-scroll {
        gap: 8px;
        padding: 8px 10px;
        mask-image: none;
        -webkit-mask-image: none;
        scroll-snap-type: x proximity;
        width: 100%;
    }

    .voice-style {
        scroll-snap-align: start;
    }
}

/* Enhanced Container Styles */
.text-to-speech-container {
    background: #ffffff;
    border-radius: 24px;
    padding: 2.5rem;
    margin: 2rem auto;
}

/* Modernized Header */
.tts-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.tts-icon-wrapper {
    position: relative;
    margin-top: 16px;
}

.tts-icon {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    position: relative;
    z-index: 2;
}

.icon-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--color-primary), 0.1), rgba(var(--color-primary-hover), 0.1));
    animation: pulse 2s infinite;
}

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

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tts-title {
    width: -webkit-fill-available;
}

.tts-title .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1E293B, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.tts-title .subtitle {
    color: #64748B;
    font-size: 14px;
    line-height: 1.5;
    max-width: 80%;
}

/* Professional Usage Limit Overlay */
.usage-limit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.usage-limit-content {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.usage-limit-header {
    margin-bottom: 2rem;
}

.usage-limit-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.3);
    animation: shieldPulse 2s infinite;
}

@keyframes shieldPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(0, 123, 255, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(0, 123, 255, 0.4);
    }
}

.usage-limit-title h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.75rem;
}

.usage-limit-title p {
    color: #64748B;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.usage-limit-features {
    margin: 2rem 0;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    color: #374151;
    font-size: 1rem;
}

.feature-item i {
    color: var(--color-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.usage-limit-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.btn-upgrade-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-upgrade-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    color: white;
}

.btn-upgrade-secondary {
    background: white;
    color: #374151;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 2px solid #E5E7EB;
    transition: all 0.3s ease;
}

.btn-upgrade-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
    transform: translateY(-1px);
}

.usage-limit-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E7EB;
}

.usage-limit-footer p {
    color: #6B7280;
    font-size: 0.95rem;
    margin: 0;
}

.usage-limit-footer a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.usage-limit-footer a:hover {
    text-decoration: underline;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive design for usage limit modal */
@media (max-width: 768px) {
    .usage-limit-content {
        padding: 2rem;
        margin: 1rem;
    }

    .usage-limit-title h3 {
        font-size: 1.5rem;
    }

    .usage-limit-title p {
        font-size: 1rem;
    }

    .usage-limit-actions {
        flex-direction: column;
    }

    .btn-upgrade-primary,
    .btn-upgrade-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

}

/* Enhanced animations for better UX */
.usage-limit-overlay {
    transition: all 0.3s ease;
}

.usage-limit-content {
    transition: all 0.3s ease;
}

/* Add subtle hover effects to feature items */
.feature-item {
    transition: all 0.2s ease;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

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

/* Controls Section */
.tts-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1E293B;
    font-weight: 500;
    font-size: 14px;
}

.control-label i {
    color: var(--color-primary);
    font-size: 14px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    clip-path: polygon(50% 75%, 0 25%, 100% 25%);
    pointer-events: none;
}

/* Text Editor Styling */
.text-editor-section {
    margin-bottom: 2rem;
}

.text-editor {
    /* background: #F8FAFC; */
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
    margin: 10px;
    position: relative;
}

.text-to-speech-container .form-switch {
    padding-left: 10px;
}

.text-editor:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.text-editor textarea {
    border: none;
    background: transparent;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #1E293B;
    resize: vertical;
    min-height: 150px;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0rem 1.5rem;
    /* background: white; */
    border-top: 1px solid #E2E8F0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.text-editor .character-counter {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: #94A3B8;
    font-size: 0.85rem;
    z-index: 10;
}

.counter-icon {
    width: 24px;
    height: 24px;
    /* background: #F1F5F9; */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.counter-text {
    color: #94A3B8;
    font-size: 14px;
}

.counter-label {
    color: #64748B;
    font-size: 14px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: white;
    color: #64748B;
    transition: all 0.3s ease;
    font-size: 14px;
}

.settings-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.clear-btn:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

/* Generate Button */
.action-section {
    text-align: center;
    margin: 2.5rem 0;
    width: fit-content
}

.generate-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 60px;
    width: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.loader-svg {
    height: 30px;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    font-size: 22px;
}

/* Hide play and pause icons by default */
#btnPlayIcon,
#btnPauseIcon {
    display: none !important;
}

/* Show icons when needed */
#btnPlayIcon.show,
#btnPauseIcon.show {
    display: block !important;
}

/* Audio Result Section */
.audio-result {
    margin-top: 2.5rem;
}

.result-card {
    background: linear-gradient(to right, #F8FAFC, #FFFFFF);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    gap: 2.5rem;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.audio-section {
    flex: 1;
}

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

.audio-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-icon {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.title-text h6 {
    margin: 0;
    color: #1E293B;
    font-weight: 600;
}

.audio-status {
    font-size: 0.85rem;
    color: #64748B;
}

.quality-badge {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-player-wrapper {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.custom-audio-player {
    width: 100%;
    height: 40px;
    border-radius: 8px;
}

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

.download-btn {
    background: linear-gradient(135deg, #4F46E5, #2563EB);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.format-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748B;
    font-size: 0.85rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .text-to-speech-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .tts-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-card {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .audio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .toolbar-right {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Select2 Custom Styles */
.select2-container{
    width: 100% !important;
}
.select2-container--default .select2-selection--single {
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8f9fa;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px;
    padding-left: 1rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
}

.select2-dropdown {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #518BF4;
}

/* Enhanced Button Styles */
.action-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: white;
    color: #64748B;
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    width: max-content;
}

.action-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    /* background: #F1F5F9; */
    transition: all 0.3s ease;
}

.action-btn .btn-text {
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.action-btn .btn-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
}

/* Settings Button Hover */
.settings-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.settings-btn:hover .btn-icon {
    background: rgba(255, 255, 255, 0.2);
}

.settings-btn:hover .btn-indicator {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
}

/* Clear Button Hover */
.clear-btn:hover {
    background: #EF4444;
    border-color: #EF4444;
    color: white;
    transform: translateY(-1px);
}

.clear-btn:hover .btn-icon {
    background: rgba(255, 255, 255, 0.2);
}

.clear-btn:hover .btn-indicator {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
}

/* Sample Button Hover */
.sample-btn:hover {
    background: #10B981;
    border-color: #10B981;
    color: white;
    transform: translateY(-1px);
}

.sample-btn:hover .btn-icon {
    background: rgba(255, 255, 255, 0.2);
}

.sample-btn:hover .btn-indicator {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
}

/* Primary Button (Generate) */
.primary-btn {
    position: relative;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    border: none;
    background: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.primary-btn .btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: white;
    width: 24px;
}

.primary-btn .btn-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
}

.primary-btn:hover .btn-background {
    filter: brightness(1.1);
}

.primary-btn:active .btn-background {
    filter: brightness(0.9);
}

.primary-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Character Counter */
.character-counter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    /* background: #F8FAFC; */
    border-radius: 12px;
    color: #64748B;
}

.counter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #EEF2FF;
    color: var(--color-primary);
    font-size: 14px;
}

.counter-text {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 14px;
}

.current-count {
    font-weight: 600;
    color: #1E293B;
    font-size: 14px;
}

.max-count {
    color: #94A3B8;
    font-size: 14px;
}

.counter-label {
    color: #94A3B8;
    font-size: 14px;
}

/* Message Styles */
.message-container {
    margin: 1rem 0;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.error {
    background: #FEF2F2;
    border: 1px solid #FEE2E2;
}

.message.success {
    background: #F0FDF4;
    border: 1px solid #DCFCE7;
}

.message-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message.error .message-icon {
    background: #EF4444;
    color: white;
}

.message.success .message-icon {
    background: #22C55E;
    color: white;
}

.message-content {
    flex: 1;
}

.message-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.message.error .message-title {
    color: #991B1B;
}

.message.success .message-title {
    color: #166534;
}

.message-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.error .message-text {
    color: #B91C1C;
}

.message.success .message-text {
    color: #15803D;
}

.message-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #64748B;
    transition: all 0.3s ease;
}

.message-close:hover {
    color: #1E293B;
}

/* Loading Spinner */
.spinner-wrapper {
    position: absolute;
    right: 1rem;
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: white;
}

/* Disabled State */
/* .primary-btn:disabled {
opacity: 0.7;
cursor: not-allowed;
} */

.primary-btn:disabled:hover {
    transform: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        gap: 1rem;
        padding: 10px !important;
    }

    .toolbar-right {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .message {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .message-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
}

/* Enhanced Modal Styles */
.custom-modal .modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 2rem;
    /* background: linear-gradient(145deg, #f8fafc, #ffffff); */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px 24px 0 0;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--color-primary), #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}

.modal-subtitle {
    font-size: 14px;
    color: #64748B;
    margin: 0.5rem 0 0 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    /* background: #F1F5F9; */
    color: #64748B;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #E2E8F0;
    color: #1E293B;
    transform: rotate(90deg);
}

/* Settings Styles */
/* Modern Modal Styles */
.modern-modal {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Desktop Modal Optimization */
.desktop-modal {
    min-width: 600px;
    width: 90%;
}

@media (min-width: 768px) {
    .desktop-modal {
        max-width: 350px;
        width: 400px;
    }
}

@media (min-width: 992px) {
    .desktop-modal {
        max-width: 380px;
        width: 420px;
    }
}

@media (min-width: 1200px) {
    .desktop-modal {
        max-width: 400px;
        width: 450px;
    }
}

/* Modal backdrop optimization for desktop */
@media (min-width: 768px) {
    .modal-backdrop {
        background-color: rgba(0, 0, 0, 0.4);
    }
}

/* Better modal positioning */
.modal.show .modal-dialog {
    transform: none;
}

/* Compact layout for desktop */
@media (min-width: 992px) {
    .setting-control {
        max-width: 180px;
    }

    .slider-value {
        min-width: 50px;
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .modern-slider {
        height: 5px;
    }

    .modern-slider::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }

    .modern-slider::-moz-range-thumb {
        width: 18px;
        height: 18px;
    }
}

.modern-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #1e40af) 100%);
    color: white;
    border: none;
    padding: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.header-text .modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: white;
}

.header-text .modal-subtitle {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    color: white;
}

.header-icon i {
    font-size: 16px;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.btn-close i {
    color: white;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.modern-body {
    padding: 1.5rem;
}

/* Desktop-specific optimizations */
@media (min-width: 768px) {
    .modern-body {
        padding: 1.25rem;
    }

    .setting-item {
        padding: 0.875rem;
        margin-bottom: 0.625rem;
    }

    .reset-section {
        margin-top: 0.75rem;
        padding: 0.875rem;
    }

    .modern-footer {
        padding: 1.25rem;
    }
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.setting-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
}

.setting-label i {
    color: var(--color-primary);
    font-size: 1rem;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 200px;
}

.modern-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    transition: all 0.3s ease;
}

.modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
}

.modern-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.6);
}

.modern-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

.slider-value {
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.reset-section {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.reset-section .btn-reset-modern {
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.reset-section .btn-reset-modern:hover {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-footer {
    background: white;
    border: none;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-reset-modern {
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-reset-modern:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-cancel {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #e5e7eb;
    color: #374151;
}

.btn-apply {
    background: var(--color-primary);
    border: none;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.4);
    background: var(--color-primary-dark, #1e40af);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modern-modal {
        margin: 1rem;
    }

    .modern-header {
        padding: 1rem;
    }

    .modern-body {
        padding: 1rem;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .setting-control {
        width: 100%;
        max-width: none;
    }

    .reset-section {
        margin-top: 0.75rem;
        padding: 0.75rem;
    }

    .reset-section .btn-reset-modern {
        padding: 10px;
        font-size: 14px;
    }

    .modern-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .footer-actions {
        justify-content: center;
    }
}

.settings-label {
    flex: 1;
}

.settings-label h6 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
}

.settings-label p {
    font-size: 1rem;
    color: #64748B;
    margin: 0.25rem 0 0 0;
}

.settings-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Enhanced Slider Styles */
.slider-container {
    position: relative;
    padding: 1rem 0;
}

.custom-range {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: transparent;
    margin: 1rem 0;
    position: relative;
    z-index: 2;
}

.range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    transform: translateY(-50%);
}

.range-progress {
    position: absolute;
    height: 100%;
    background: linear-gradient(to right, var(--color-primary), #2563EB);
    border-radius: 4px;
    width: 50%;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.2);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.range-label {
    font-size: 1rem;
    color: #64748B;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
}

.range-label:hover {
    color: var(--color-primary);
    background: rgba(79, 70, 229, 0.1);
}

.range-label.active {
    color: var(--color-primary);
    font-weight: 600;
    background: rgba(79, 70, 229, 0.1);
}

/* Format Cards */
.format-grid {
    display: grid;
    gap: 1.25rem;
}

.format-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-radius: 20px;
    /* background: #F8FAFC; */
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.format-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.format-card:hover {
    background: #F1F5F9;
    transform: translateY(-2px);
}

.format-card.selected {
    border-color: var(--color-primary);
    background: #EEF2FF;
}

.format-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.75rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.format-info h6 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 0.5rem 0;
}

.format-info p {
    font-size: 1rem;
    color: #64748B;
    margin: 0;
}

.format-badges {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.format-badges .badge {
    background: var(--color-primary);
    color: white;
}

.vedio-tab-area .badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: white;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.format-select {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.select-ring {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    transform: scale(0);
    transition: all 0.3s ease;
}

.format-card.selected .format-select {
    border-color: var(--color-primary);
}

.format-card.selected .select-ring {
    transform: scale(1);
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: auto;
}

.download-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748B;
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-reset {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: #64748B;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    color: #EF4444;
}

.btn-secondary {
    padding: 0.875rem 1.75rem;
    border-radius: 14px;
    border: none;
    background: #F1F5F9;
    color: #64748B;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.text-editor textarea {
    font-size: 16px;
    /* Prevent mobile zoom */
}

/* Prevent zoom on all input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    font-size: 16px !important;
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
    .text-editor textarea {
        font-size: 16px;
        line-height: 1.5;
        padding: 1rem;
    }

    .control-label {
        font-size: 16px;
    }

    .action-btn {
        min-height: 44px;
        /* Apple's recommended minimum touch target */
    }

    .generate-btn {
        min-height: 44px;
        font-size: 16px;
    }
}

.btn-outline-primary {
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    padding: 0.875rem 1.75rem;
}

.btn-primary {
    padding: 0.875rem 1.75rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(145deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(var(--color-primary), 0.2);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-subtitle {
        font-size: 14px;
    }

    .settings-label h6 {
        font-size: 1.1rem;
    }

    .format-grid {
        grid-template-columns: 1fr;
    }

    .format-badges {
        flex-wrap: wrap;
    }

    .modal-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-actions {
        width: 100%;
    }

    .btn-secondary,
    .btn-primary {
        padding: 0.875rem 1.75rem !important;
        justify-content: center;
    }
}

/* Add to your existing styles */
.settings-group {
    transition: all 0.3s ease;
}

.settings-changed {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
}

#settingsMessage {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: none;
}

.message {
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Add these styles to your existing CSS */
.validation-details {
    margin-top: 0.75rem;
}

.validation-details p {
    color: #64748B;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.validation-details ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: none;
}

.validation-details li {
    color: #64748B;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    position: relative;
    padding-left: 1.25rem;
}

.validation-details li:before {
    content: "•";
    color: #EF4444;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.message {
    background: #FEF2F2;
    border: 1px solid #FEE2E2;
    border-left: 4px solid #EF4444;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    animation: slideIn 0.3s ease;
}

.message-icon {
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 24px;
    height: 24px;
    background: #EF4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.message-content {
    padding-left: 2.5rem;
}

.message-title {
    color: #991B1B;
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.message-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #64748B;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.message-close:hover {
    color: #EF4444;
}

.text-editor .character-counter {
    transition: all 0.3s ease;
}

.current-count {
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Replace previous error styles with these simplified ones */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.alert-danger {
    background-color: #FEF2F2;
    border: 1px solid #FEE2E2;
    color: #991B1B;
}

.btn-close {
    background: none;
    border: none;
    padding: 0;
    font-size: 18px;
    color: #64748B;
    cursor: pointer;
}

.btn-close:hover {
    color: #1F2937;
}

/* Pause Controls Styles */
.pause-controls {
    display: flex;
    gap: 0.75rem;
    margin-left: 1rem;
}

.pause-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: white;
    color: #64748B;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pause-btn:hover {
    background: #F8FAFC;
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.pause-btn i {
    font-size: 16px;
}

.pause-btn .duration {
    font-size: 14px;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.pause-btn:hover .duration {
    background: #EEF2FF;
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .toolbar-left {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .text-editor .character-counter {
        position: absolute;
        bottom: 8px;
        right: 12px;
        font-size: 0.75rem;
    }

    .pause-controls {
        order: 1;
        flex-direction: row;
        gap: 0.5rem;
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .pause-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 15px;
        font-size: 12px;
        gap: 0.25rem;
    }

    .pause-btn span {
        font-size: 14px;
    }

    .pause-btn i {
        font-size: 16px;
    }

    .max-count,
    .current-count,
    .counter-label {
        font-size: 14px;
    }

    .action-section {
        order: 3;
    }
}

@media (max-width: 480px) {
    .pause-controls {
        gap: 0.25rem;
    }

    .pause-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .pause-btn span {
        font-size: 14px;
    }

    .text-editor .character-counter {
        bottom: 3px;
        right: 10px;
        font-size: 0.7rem;
    }
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none !important;
}

/* Professional Audio Player Styles */
.professional-audio-player {
    /* background: white; */
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 1rem 0;
}

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

.audio-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.title-text h6 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1E293B;
}

.audio-status {
    font-size: 0.875rem;
    color: #64748B;
}

.quality-badge {
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

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

#waveform {
    width: 100%;
    height: 60px;
}

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

.playback-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #E2E8F0;
    background: white;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.control-btn i {
    font-size: 16px;
}

.play-btn {
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    font-size: 1.2rem;
}

.play-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.play-btn.isPlaying {
    background: #DC2626;
    border-color: #DC2626;
}

.play-btn.isPlaying:hover {
    background: #B91C1C;
    border-color: #B91C1C;
}

/* Waveform loading state */
.waveform-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .professional-audio-player {
        padding: 1.5rem;
    }

    .audio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .quality-badge {
        align-self: flex-start;
    }

    .playback-controls {
        gap: 0.75rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .play-btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
}

/* Word Highlighting Styles */
.highlighted-text-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.highlighted-text-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlighted-text-title i {
    color: #007bff;
}

.highlighted-text {
    line-height: 1.8;
    font-size: 16px;
    color: #212529;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    min-height: 60px;
    word-wrap: break-word;
}

.word-highlight {
    display: inline-block;
    padding: 2px 4px;
    margin: 1px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.word-highlight:hover {
    background-color: #e3f2fd;
    transform: translateY(-1px);
}

.word-highlight.highlighted {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.word-no-timing {
    display: inline-block;
    padding: 2px 4px;
    margin: 1px;
    color: #6c757d;
    opacity: 0.7;
}

/* Word Highlighting Toggle */
.word-highlighting-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.word-highlighting-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

.word-highlighting-toggle label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    margin: 0;
}

.word-highlighting-toggle .toggle-description {
    font-size: 14px;
    color: #6c757d;
    margin-left: auto;
}

/* Animation for word highlighting */
@keyframes wordHighlight {
    0% {
        background-color: transparent;
        transform: scale(1);
    }

    50% {
        background-color: #007bff;
        color: white;
        transform: scale(1.05);
    }

    100% {
        background-color: #007bff;
        color: white;
        transform: scale(1);
    }
}

.word-highlight.highlighted {
    animation: wordHighlight 0.3s ease-in-out;
}

/* Responsive design for word highlighting */
@media (max-width: 768px) {
    .highlighted-text-container {
        padding: 15px;
        margin-top: 15px;
    }

    .highlighted-text {
        font-size: 14px;
        padding: 12px;
    }

    .word-highlighting-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .word-highlighting-toggle .toggle-description {
        margin-left: 0;
    }
}

/* Download Modal Format Cards */
.format-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    background: #f8f9fa;
    margin-bottom: 16px;
    position: relative;
    z-index: 1051;
}

.format-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.format-card.selected {
    border-color: #007bff;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.format-card .format-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.format-card .format-icon {
    width: 48px;
    height: 48px;
    background: #007bff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.format-card .format-info {
    flex: 1;
}

.format-card .format-info h4 {
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-weight: 600;
}

.format-card .format-info p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
}

.format-card .format-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.format-card .badge {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.format-card .format-select {
    position: relative;
}

.format-card .select-ring {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.format-card.selected .select-ring {
    border-color: #007bff;
    background: #007bff;
}

.format-card.selected .select-ring::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Dark theme support */
[data-theme="dark"] .format-card {
    background: #2d3748;
    color: #f7fafc;
}

[data-theme="dark"] .format-card:hover {
    background: #4a5568;
}

[data-theme="dark"] .format-card.selected {
    background: #1e40af;
    border-color: #3b82f6;
}

[data-theme="dark"] .format-card .format-info h4 {
    color: #f7fafc;
}

[data-theme="dark"] .format-card .format-info p {
    color: #a0aec0;
}

[data-theme="dark"] .format-card .badge {
    background: #3b82f6;
}

/* Fix modal backdrop z-index issues */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1051 !important;
}

.modal-content {
    z-index: 1052 !important;
    position: relative;
}

/* Ensure format cards are clickable */
.format-card * {
    pointer-events: auto;
}

.format-card {
    pointer-events: auto;
}

/* ===========================================
VOICE SETTINGS MODAL - UNIFORM STYLING
=========================================== */

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

/* Prevent modal backdrop from scrolling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

/* Ensure modal dialog is properly fixed */
#voiceSettingsModal.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Voice Settings Modal - Use uniform styling from existing modals */
#voiceSettingsModal .modal-content {
    border-radius: 24px;
}

#voiceSettingsModal .modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px 24px 0 0;
}

#voiceSettingsModal .modal-body {
    padding: 2rem;
}

#voiceSettingsModal .modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0 0 24px 24px;
}

/* Setting Items */
.setting-item {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #F8FAFC;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.setting-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.setting-label i {
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, var(--color-primary), #2563EB);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.setting-label span {
    font-size: 12px;
    font-weight: 600;
    color: #1E293B;
}

.setting-control {
    position: relative;
}

.modern-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E2E8F0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--color-primary), #2563EB);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
    border: 2px solid #ffffff;
}

.modern-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.modern-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--color-primary), #2563EB);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.slider-value {
    position: absolute;
    top: -38px;
    right: 0;
    background: linear-gradient(145deg, var(--color-primary), #2563EB);
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    min-width: 70px;
    text-align: center;
}

/* Reset Section */
.reset-section {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E2E8F0;
}

.btn-reset-modern {
    width: 100%;
    padding: 0.75rem 1.5rem;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Footer Actions */
.footer-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel {
    padding: 10px 20px;
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.btn-apply {
    padding: 10px 20px;
    background: linear-gradient(145deg, var(--color-primary), #2563EB);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* Dark Theme Support */
[data-theme="dark"] .setting-item {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .setting-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

[data-theme="dark"] .setting-label span {
    color: #E2E8F0;
}

[data-theme="dark"] .modern-slider {
    background: #334155;
}

[data-theme="dark"] .modern-slider::-webkit-slider-thumb {
    border-color: #1E293B;
}

[data-theme="dark"] .modern-slider::-moz-range-thumb {
    border-color: #1E293B;
}

[data-theme="dark"] .reset-section {
    border-color: #334155;
}

[data-theme="dark"] .btn-cancel {
    background: #334155;
    color: #E2E8F0;
    border-color: #475569;
}

[data-theme="dark"] .btn-cancel:hover {
    background: #475569;
}

/* Responsive Design */
@media (max-width: 768px) {
    #voiceSettingsModal .desktop-modal {
        min-width: max-content;
    }

    #voiceSettingsModal .modal-content {
        width: 94%;
    }

    /* Modal Container - Mobile Optimization */
    #voiceSettingsModal .modal-dialog {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        display: flex;
        flex-direction: column;
    }

    #voiceSettingsModal .modal-content {
        max-height: calc(100vh - 1rem);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #voiceSettingsModal .modal-header {
        padding: 1.5rem;
        flex-shrink: 0;
    }

    #voiceSettingsModal .modal-body {
        padding: 1.5rem;
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }

    #voiceSettingsModal .modal-footer {
        padding: 1rem 1.5rem;
        flex-shrink: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .setting-item {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }


    .btn-cancel,
    .btn-apply {
        width: 100%;
        justify-content: center;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    #voiceSettingsModal .modal-dialog {
        margin: 0.25rem;
        max-height: calc(100vh - 0.5rem);
    }

    #voiceSettingsModal .modal-content {
        max-height: calc(100vh - 0.5rem);
    }

    #voiceSettingsModal .modal-header {
        padding: 1rem;
    }

    #voiceSettingsModal .modal-body {
        padding: 1rem;
    }

    #voiceSettingsModal .modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* Voice Preview Button Styles */
.voice-option-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 4px 0;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.voice-option-text {
    flex: 1;
    margin-right: 8px;
}

.voice-preview-btn {
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 9999 !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure button is clickable even when parent has pointer-events */
.select2-results__option .voice-preview-btn {
    pointer-events: auto !important;
    z-index: 9999 !important;
}

/* Prevent Select2 from blocking button clicks */
.select2-results__option {
    pointer-events: auto !important;
}

.voice-option-wrapper {
    pointer-events: auto !important;
}

.voice-preview-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.voice-preview-btn.playing {
    background: #DC2626;
    animation: pulse-preview 1.5s ease-in-out infinite;
}

.voice-preview-btn.playing:hover {
    background: #B91C1C;
}

.voice-preview-btn i {
    font-size: 12px;
    margin: 0;
}

@keyframes pulse-preview {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0);
    }
}

/* Select2 dropdown option styling */
.select2-results__option {
    padding: 8px 12px !important;
    position: relative;
}


.select2-results__option--highlighted .voice-preview-btn {
    background: rgba(255, 255, 255, 0.2);
}

.select2-results__option--highlighted .voice-preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Ensure preview button doesn't interfere with selection */
.voice-preview-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .voice-preview-btn {
        width: 32px;
        height: 32px;
    }

    .voice-preview-btn i {
        font-size: 14px;
    }
}

/* Unified Textarea Styling with Icon */
.textarea-wrapper {
    position: relative;
}

.textarea-wrapper .conversion-text {
    width: 100%;
    min-height: 320px;
    padding: 15px 45px 15px 45px !important;
    border: 1px solid #E5E4FF;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    font-weight: 400;
    color: #1e293b;
    background: #ffffff;
    background: #ffffff;
    resize: vertical;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.textarea-wrapper .conversion-text::placeholder {
    color: #cbd5e1;
    opacity: 0.8;
}

.textarea-wrapper .conversion-text:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.textarea-wrapper .textarea-icon {
    position: absolute;
    left: 18px;
    top: 21px;
    color: #001C42;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

/* Dark Theme - Textarea */
[data-theme="dark"] .textarea-wrapper .conversion-text {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

[data-theme="dark"] .textarea-wrapper .conversion-text::placeholder {
    color: #6b7280;
}

[data-theme="dark"] .textarea-wrapper .conversion-text:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .textarea-wrapper .textarea-icon {
    color: #9ca3af;
}

/* Voice Control Toolbar */
.voice-control-toolbar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    padding: 10px 12px;
}

/* Dark Theme - Voice Control Toolbar */
[data-theme="dark"] .voice-control-toolbar {
    background: #1f2937;
    border-color: #374151;
    border-bottom-color: #374151;
}

.voice-control-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.voice-control-tab-wrapper {
    position: relative;
    flex-shrink: 0;
}

.voice-control-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
}

.voice-control-tab:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

/* Dark Theme - Voice Control Tabs */
[data-theme="dark"] .voice-control-tab {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

[data-theme="dark"] .voice-control-tab:hover {
    border-color: #6b7280;
    background: #4b5563;
}

.voice-control-tab.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.voice-control-tab.active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.voice-control-tab.preview-tab {
    background: transparent;
    border-color: transparent;
    color: #374151;
    padding-left: 8px;
}

.voice-control-tab.preview-tab:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: transparent;
}

/* Dark Theme - Preview Tab */
[data-theme="dark"] .voice-control-tab.preview-tab {
    color: #e5e7eb;
}

[data-theme="dark"] .voice-control-tab.preview-tab:hover {
    background: rgba(59, 130, 246, 0.15);
}

.voice-control-tab.preview-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.voice-control-tab.preview-tab.active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.voice-control-tab.preview-tab i {
    font-size: 16px;
}

/* Adjust textarea to connect with toolbar */
.voice-control-toolbar+.voice-styles-container+.textarea-wrapper .conversion-text {
    border-radius: 0;
    border-top: none;
}

.voice-control-toolbar+.textarea-wrapper .conversion-text {
    border-radius: 0;
    border-top: none;
}

.textarea-wrapper+.bottom-controls-bar {
    border-top: 1px solid #e5e7eb;
    margin-top: 0;
}

.voice-styles-container+.textarea-wrapper .conversion-text {
    border-top: 1px solid #e5e7eb;
}

/* Dark Theme - Border adjustments */
[data-theme="dark"] .textarea-wrapper+.bottom-controls-bar {
    border-top-color: #374151;
}

[data-theme="dark"] .voice-styles-container+.textarea-wrapper .conversion-text {
    border-top-color: #374151;
}

/* Compact Bottom Controls Bar */
.bottom-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    gap: 16px;
}

/* Dark Theme - Bottom Controls Bar */
[data-theme="dark"] .bottom-controls-bar {
    background: #1f2937;
    border-color: #374151;
}

.clear-text-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
}

.clear-text-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Dark Theme - Clear Text Button */
[data-theme="dark"] .clear-text-btn {
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .clear-text-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.clear-text-btn i {
    font-size: 14px;
    color: #ef4444;
}

.text-counter-compact {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

/* Dark Theme - Text Counter */
[data-theme="dark"] .text-counter-compact {
    color: #9ca3af;
}

.text-counter-compact #charCount,
.text-counter-compact .current-count {
    color: #10b981;
    font-weight: 600;
}

.text-counter-compact #charCount.text-warning,
.text-counter-compact .current-count.text-warning {
    color: #f59e0b !important;
}

.text-counter-compact #charCount.text-danger,
.text-counter-compact .current-count.text-danger {
    color: #ef4444 !important;
}

/* Voice Control Popover */
.voice-control-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    animation: popoverSlideIn 0.2s ease;
}

/* Dark Theme - Popover */
[data-theme="dark"] .voice-control-popover {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes popoverSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popover-options {
    padding: 8px;
}

.popover-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
    margin-bottom: 2px;
}

.popover-option:hover {
    background: #f3f4f6;
}

.popover-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.popover-option span {
    font-size: 14px;
    color: #374151;
    font-weight: 400;
}

/* Dark Theme - Popover Options */
[data-theme="dark"] .popover-option {
    color: #e5e7eb;
}

[data-theme="dark"] .popover-option:hover {
    background: #374151;
}

[data-theme="dark"] .popover-option span {
    color: #e5e7eb;
}

.popover-option:has(input:checked) {
    background: rgba(59, 130, 246, 0.08);
}

.popover-option:has(input:checked) span {
    color: var(--color-primary);
    font-weight: 500;
}

/* Dark Theme - Checked Popover Option */
[data-theme="dark"] .popover-option:has(input:checked) {
    background: rgba(59, 130, 246, 0.2);
}

.popover-actions {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e5e7eb;
    padding: 8px;
    gap: 8px;
}

/* Dark Theme - Popover Actions */
[data-theme="dark"] .popover-actions {
    border-top-color: #374151;
}

/* Dark Theme - Editor Help Note */
[data-theme="dark"] .editor-help-note {
    background: rgba(55, 65, 81, 0.3) !important;
    border-left-color: rgba(59, 130, 246, 0.6) !important;
    color: #d1d5db;
}

[data-theme="dark"] .editor-help-note code {
    background: rgba(31, 41, 55, 0.5);
    color: #60a5fa;
}

.popover-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popover-btn-clear {
    background: #f3f4f6;
    color: #6b7280;
}

.popover-btn-clear:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Dark Theme - Popover Buttons */
[data-theme="dark"] .popover-btn-clear {
    background: #374151;
    color: #d1d5db;
}

[data-theme="dark"] .popover-btn-clear:hover {
    background: #4b5563;
    color: #e5e7eb;
}

.popover-btn-apply {
    background: var(--color-primary);
    color: white;
}

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

/* Pause Popover Styles */
.pause-popover {
    min-width: 280px;
}

.pause-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
}

.pause-option-btn {
    padding: 10px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.pause-option-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.pause-option-btn:active {
    transform: translateY(0);
}

/* Dark Theme - Pause Option Buttons */
[data-theme="dark"] .pause-option-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

[data-theme="dark"] .pause-option-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
}

.pause-custom-section {
    padding: 10px 12px 12px;
    border-top: 1px solid #e5e7eb;
}

/* Dark Theme - Pause Custom Section */
[data-theme="dark"] .pause-custom-section {
    border-top-color: #374151;
}

.pause-custom-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pause-custom-input {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    outline: none;
    transition: all 0.2s ease;
}

.pause-custom-input:focus {
    border-color: var(--color-primary);
    background: #ffffff;
}

.pause-custom-input::placeholder {
    color: #9ca3af;
}

/* Dark Theme - Pause Custom Input */
[data-theme="dark"] .pause-custom-input {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

[data-theme="dark"] .pause-custom-input:focus {
    background: #4b5563;
    border-color: var(--color-primary);
}

[data-theme="dark"] .pause-custom-input::placeholder {
    color: #6b7280;
}

.pause-custom-unit {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

/* Dark Theme - Pause Custom Unit */
[data-theme="dark"] .pause-custom-unit {
    color: #9ca3af;
}

.pause-custom-add-btn {
    padding: 8px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pause-custom-add-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.pause-custom-add-btn:active {
    transform: translateY(0);
}

/* Button Wrapper Generator */
.button-wrapper-generator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* 
.btn-gradient {
background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
color: white;
border: none;
padding: 12px 24px;
border-radius: 8px;
font-weight: 600;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 8px;
}

.btn-gradient:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-gradient-outline {
background: transparent;
color: var(--color-primary);
border: 2px solid var(--color-primary);
padding: 12px 24px;
border-radius: 8px;
font-weight: 600;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 8px;
}

.btn-gradient-outline:hover {
background: var(--color-primary);
color: white;
transform: translateY(-2px);
} */
.btn-gradient-outline {
    padding: 15px 24px !important;
}

.btn-with-loader .loader-icon {
    margin-left: 8px;
}

/* Generate button loading state */
#generateBtn.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

#generateBtn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Toggle Switch Styles */
#fileUploadToggleSection {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    transition: all 0.2s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

#fileUploadToggleSection:hover {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Dark Theme - File Upload Toggle Section */
[data-theme="dark"] #fileUploadToggleSection {
    background: rgba(55, 65, 81, 0.3);
    border-color: rgba(75, 85, 99, 0.5);
}

[data-theme="dark"] #fileUploadToggleSection:hover {
    background: rgba(55, 65, 81, 0.5);
    border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] #fileUploadToggleSection .toggle-switch-label {
    color: #e5e7eb;
}

#fileUploadToggleSection .toggle-switch-checkbox,
#backgroundSoundSection .toggle-switch-checkbox {
    margin: 0;
}

#fileUploadToggleSection .toggle-switch-label,
#backgroundSoundSection .toggle-switch-label {
    margin: 0;
    padding-left: 30px;
}

.toggle-switch-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #ffffff;
    border: 2.5px solid #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    flex-shrink: 0;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.toggle-switch-checkbox:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.toggle-switch-checkbox::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.toggle-switch-checkbox:checked {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 2px 4px rgba(59, 130, 246, 0.2);
}

.toggle-switch-checkbox:checked::after {
    display: block;
    opacity: 1;
}

.toggle-switch-checkbox:checked:hover {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 2px 6px rgba(59, 130, 246, 0.3);
}

.toggle-switch-checkbox:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.toggle-switch-checkbox:checked:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Dark Theme - Toggle Switch Checkbox */
[data-theme="dark"] .toggle-switch-checkbox {
    background: #374151;
    border-color: #6b7280;
}

[data-theme="dark"] .toggle-switch-checkbox:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .toggle-switch-checkbox:checked {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
    border-color: var(--color-primary);
}

.toggle-switch-label {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
    flex: 1;
    margin: 0;
    line-height: 1.5;
}

/* Dark Theme - Toggle Switch Label */
[data-theme="dark"] .toggle-switch-label {
    color: #e5e7eb;
}

/* Mobile responsive for toggle */
@media (max-width: 768px) {
    #fileUploadToggleSection {
        padding: 10px 12px;
        gap: 10px;
    }

    .toggle-switch-checkbox {
        width: 20px;
        height: 20px;
    }

    .toggle-switch-checkbox::after {
        left: 6px;
        top: 2px;
        width: 4px;
        height: 9px;
        border-width: 0 2px 2px 0;
    }

    .toggle-switch-label {
        font-size: 13px;
    }
}

/* Top Controls Panel */
.top-controls-panel {
    margin-bottom: 1.5rem;
}

.top-controls-panel .form-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.top-controls-panel .form-select {
    font-size: 14px;
}

/* Audio Main Generator Start */
.audio-main-generator-start {
    background: #ffffff;
}

/* Dark Theme - Main Generator Container */
[data-theme="dark"] .audio-main-generator-start {
    background: #1f2937;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .voice-control-tabs {
        gap: 6px;
        flex-wrap: wrap;
    }

    .voice-control-tab {
        padding: 6px 12px;
        font-size: 12px;
        flex-shrink: 0;
        width: auto;
    }

    .bottom-controls-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .text-counter-compact {
        width: 100%;
    }

    .button-wrapper-generator {
        flex-direction: column;
        width: 100%;
    }

    .btn-gradient,
    .btn-gradient-outline {
        width: 100%;
        justify-content: center;
    }

    .toggle-switch-checkbox {
        width: 20px;
        height: 20px;
    }

    .toggle-switch-checkbox::after {
        width: 16px;
        height: 16px;
    }

    .toggle-switch-checkbox:checked::after {
        left: 22px;
        display: none !important;
    }

    .toggle-switch-label {
        font-size: 13px;
    }
}