/* Form Elements */
#falai-tts-generator-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Credit Cost Labels */
#falai-tts-credit-cost {
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-left: 3px solid #0274be;
    border-radius: 3px;
}

#falai-tts-credit-cost div {
    padding: 3px 0;
}

#falai-tts-generator-form textarea,
#falai-tts-generator-form select,
#falai-tts-generator-form input[type="number"],
#falai-tts-generator-form input[type="range"],
#falai-tts-generator-form input[type="text"] { /* Added input[type="range"] and input[type="text"] */
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Dropdowns Container */
.falai-tts-dropdown-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 14px;
}
/* Add to falai-fdsddg.css if preferred over inline style */
.falai-tts-model-selector label {
    margin-right: 15px; /* Add spacing between radio buttons */
    font-weight: normal; /* Adjust font weight if needed */
}
 .falai-tts-model-selector {  
 display: inline-flex;
 margin-bottom: 14px;
}
span#falai-speed-value { /* Updated ID */
    float: right;
}
.falai-tts-dropdown { /* Updated Class */
    width: calc(50% - 7.5px); /* Ensures two per row with gap */
}

#falai-tts-generator-form button, /* Updated ID */
button#falai-generate-tts { /* Added specific button ID for more specificity */
    padding: 10px 20px;
    background-color: #0274be;
    color: white;
    border: none;
    cursor: pointer;
    display: block;
    width: 100%;
}

/* Audio Output and History */
#falai-tts-audio-output { /* Updated ID - if you are using this, otherwise you might remove if not used */
    margin-top: 20px;
}

h2.falai-history-heading { /* Updated Class */
    margin-top: 20px;
}

ul.falai-tts-history-list { /* Updated Class */
    padding: 0;
    list-style: none;
}

.falai-tts-history-list li { /* Updated Class */
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.falai-tts-history-list li p { /* Updated Class */
    margin-top: 0;
    margin-bottom: 5px;
}

.falai-tts-history-list li audio { /* Updated Class */
    width: 100%;
    margin-bottom: 10px;
}

p.falai-history-timestamp { /* Updated Class */
    font-size: 0.9em;
    color: #777;
}

div#falai-tts-generation-history { /* Updated ID */
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Character Count */
#falai-tts-char-count { /* Updated ID */
    font-size: 0.9em;
    color: #777;
    margin-bottom: 10px;
    position: relative;
    top: -50px;
    text-align: right;
    right: 8px;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    background-color: #f0f0f0;
    padding: 3px;
    border-radius: 3px;
    margin: 10px 0;
}

.progress-bar {
    height: 20px;
    background-color: #4CAF50;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
    position: relative;
}

.progress-bar-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
    line-height: 20px;
}

button#falai-generate-tts:disabled { /* Updated ID */
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Voice Selector Dropdown */
.falai-voice-dropdown .falai-voice-selector { /* Updated Class */
    position: relative;
    cursor: pointer;
}

.falai-voice-dropdown .falai-voice-selector-display { /* Updated Class */
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.falai-voice-dropdown.active .falai-voice-selector-display { /* Updated Class */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

button.falai-voice-sample-button.play { /* Updated Class */
    background: transparent !important;
    width: 20% !important;
}

.falai-voice-dropdown .falai-voice-options-container { /* Updated Class */
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    overflow: hidden;
    background-color: white;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-height: 150px; /* Reduced height */
    overflow-y: auto;   /* Added scrollbar */
}

.falai-voice-dropdown.active .falai-voice-options-container { /* Updated Class */
    display: block;
}

.falai-voice-dropdown .falai-voice-option { /* Updated Class */
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.falai-voice-dropdown .falai-voice-option:hover, /* Updated Class */
.falai-voice-dropdown .falai-voice-option.selected { /* Updated Class */
    background-color: #f0f0f0;
}

.falai-voice-dropdown .falai-voice-option:not(:last-child) { /* Updated Class */
    border-bottom: 1px solid #eee;
}

.falai-voice-dropdown .falai-voice-sample-button { /* Updated Class */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    color: #333;
}

.falai-voice-dropdown .falai-voice-sample-button:focus { /* Updated Class */
    outline: none;
}

.falai-voice-dropdown .falai-voice-sample-button .dashicons { /* Updated Class */
    font-size: 20px;
    color: #6495ED;
    float: right;
    line-height: 1;
    width: 20px;
    height: 20px;
}

/* Download Buttons */
.falai-download-buttons { /* Updated Class */
    display: flex;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 5px;
}

.falai-download-buttons button { /* Updated Class */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border: none;
    width: auto;
}

.falai-download-buttons button.falai-download-audio { /* Updated Class */
    background-color: #4CAF50;
    color: white;
}

.falai-download-buttons button.falai-download-text { /* Updated Class */
    background-color: #2196F3;
    color: white;
}

.falai-download-buttons button:hover { /* Updated Class */
    opacity: 0.9;
    transform: translateY(-1px);
}

.falai-download-buttons button:active { /* Updated Class */
    transform: translateY(0);
}

.falai-download-buttons .dashicons { /* Updated Class */
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Error States */
.error {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Additional Settings Styling */
.falai-tts-additional-settings-wrapper {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.falai-tts-additional-settings-header {
    background-color: #f5f5f5;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.falai-tts-additional-settings-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.falai-tts-additional-settings-content {
    padding: 15px;
    border-top: 1px solid #ddd;
}

.falai-tts-additional-settings-header .dashicons {
    transition: transform 0.3s ease;
}

.falai-tts-additional-settings-header.active .dashicons {
    transform: rotate(180deg);
}

/* Responsive Styles */
@media (max-width: 600px) {
    .falai-tts-dropdown { /* Updated Class */
        width: 100%;
    }

    .falai-voice-dropdown .falai-voice-options-container { /* Updated Class */
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        max-height: none; /* Remove max-height for full display on small screens */
        overflow-y: visible; /* Disable scroll on small screens */
        height: 214px;
    }

    .falai-voice-dropdown.active .falai-voice-selector-display { /* Updated Class */
        border-radius: 4px 4px 0 0;
    }

    .falai-voice-dropdown .falai-voice-selector-display { /* Updated Class */
        border-radius: 4px;
    }

    .falai-download-buttons { /* Updated Class */
        flex-direction: column;
    }

    .falai-download-buttons button { /* Updated Class */
        width: 100%;
    }
}

/* Loading States */
.processing {
    opacity: 0.7;
}

/* Scrollbar Styling for Voice Dropdown - Webkit Browsers (Chrome, Safari) */
.falai-voice-dropdown .falai-voice-options-container::-webkit-scrollbar {
    width: 6px; /* Adjust scrollbar width as needed */
}

.falai-voice-dropdown .falai-voice-options-container::-webkit-scrollbar-track {
    background: #f1f1f1; /* Scrollbar track color */
}

.falai-voice-dropdown .falai-voice-options-container::-webkit-scrollbar-thumb {
    background: #888; /* Scrollbar thumb color */
    border-radius: 3px; /* Rounded corners for thumb */
}

.falai-voice-dropdown .falai-voice-options-container::-webkit-scrollbar-thumb:hover {
    background: #555; /* Darker thumb color on hover */
}

/* Scrollbar Styling for Voice Dropdown - Firefox */
.falai-voice-dropdown .falai-voice-options-container {
    scrollbar-color: #888 #f1f1f1; /* thumb and track color respectively */
    scrollbar-width: thin;  /* 'auto' or 'thin' */
}

/* Scrollbar Styling for History - Keep existing styling */
#falai-tts-generation-history::-webkit-scrollbar {
    width: 6px;
}

#falai-tts-generation-history::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#falai-tts-generation-history::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#falai-tts-generation-history::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Force download style for audio player */
.falai-audio-player-container {
    margin: 10px 0;
    display: block;
    width: 100%;
}

.falai-audio-player-container audio {
    width: 100%;
    border-radius: 4px;
}

.falai-download-audio {
    background-color: #009f06 !important;
    color: #fff !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 4px;
    border: none;
    margin-right: 10px;
    text-decoration: none;
}

.falai-download-audio:hover {
    background-color: #007d05 !important;
}

/* Make sure the dashicons in buttons are properly aligned */
.falai-download-buttons .dashicons {
    margin-right: 5px;
}

.falai-tts-dropdown select,
.falai-tts-dropdown input[type=text],
.falai-tts-dropdown input[type=number] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
    box-sizing: border-box;
}

/* Custom voice styling */
.falai-voice-info[data-voice-id="custom"] {
    color: inherit; /* Match the default text color */
    font-weight: normal; /* Same as regular voices */
}

/* Voice type selector emphasis */
#falai-voice-type {
    font-weight: bold;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
}

/* Style for custom voice dropdown */
.falai-custom-voice-dropdown select {
    width: 100%;
    padding: 8px;
    border: 1px solid #4CAF50; /* Green border for emphasis */
    border-radius: 4px;
    margin-top: 5px;
    background-color: #f8fff8; /* Light green background */
}