/* Form Elements */
#fptai-tts-generator-form label { /* Added fptai-tts-generator-form ID prefix */
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#fptai-tts-generator-form textarea, /* Added fptai-tts-generator-form ID prefix */
#fptai-tts-generator-form select, /* Added fptai-tts-generator-form ID prefix */
#fptai-tts-generator-form input[type="number"] { /* Added fptai-tts-generator-form ID prefix */
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Dropdowns Container */
.fptai-tts-dropdown-container { /* Changed class name */
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.fptai-tts-dropdown { /* Changed class name */
    width: calc(50% - 7.5px); /* Ensures two per row with gap */
}

#fptai-tts-generator-form button { /* Added fptai-tts-generator-form ID prefix */
    padding: 10px 20px;
    background-color: #0274be;
    color: white;
    border: none;
    cursor: pointer;
    display: block;
    width: 100%;
}
/* FPT AI Speed Slider */
#fptai-tts-speed {
    width: 100%; /* Make the slider full width of its container */
    margin-bottom: 5px; /* Add some space below the slider */
}

#fptai-speed-value {
    display: block; /* Display value on a new line */
    float: right; /* Center the value */
    font-size: 0.9em; /* Smaller font size for the value */
    color: #777; /* Gray color for the value */
    margin-bottom: 15px; /* Space below the value */
}
/* Audio Output and History */
#fptai-tts-audio-output { /* Changed ID name - if you have this in CSS, otherwise remove if not used */
    margin-top: 20px;
}

h2.fptai-history-heading { /* Changed class name */
    margin-top: 20px;
}

ul.fptai-tts-history-list { /* Changed class name */
    padding: 0;
    list-style: none;
}

.fptai-tts-history-list li { /* Changed class name */
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.fptai-tts-history-list li p { /* Changed class name */
    margin-top: 0;
    margin-bottom: 5px;
}

.fptai-tts-history-list li audio { /* Changed class name */
    width: 100%;
    margin-bottom: 10px;
}

.fptai-history-timestamp { /* Changed class name */
    font-size: 0.9em;
    color: #777;
}

div#fptai-tts-generation-history { /* Changed ID name */
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Character Count */
#fptai-tts-char-count { /* Changed ID name */
    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;
}

#fptai-generate-tts:disabled { /* Changed ID name */
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Voice Selector Dropdown */
.fptai-voice-dropdown .fptai-voice-selector { /* Changed class name */
    position: relative;
    cursor: pointer;
}

.fptai-voice-dropdown .fptai-voice-selector-display { /* Changed class name */
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fptai-voice-dropdown.active .fptai-voice-selector-display { /* Changed class name */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

button.fptai-voice-sample-button.play { /* Changed class name */
    background: transparent !important;
    width: 20% !important;
}

.fptai-voice-dropdown .fptai-voice-options-container { /* Changed class name */
    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: 316px; /* Reduced height */
    overflow-y: auto;   /* Added scrollbar */
}
.fptai-voice-options-container {
    scrollbar-width: thin;
}

.fptai-voice-dropdown.active .fptai-voice-options-container { /* Changed class name */
    display: block;
}

.fptai-voice-dropdown .fptai-voice-option { /* Changed class name */
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.fptai-voice-dropdown .fptai-voice-option:hover, /* Changed class name */
.fptai-voice-dropdown .fptai-voice-option.selected { /* Changed class name */
    background-color: #f0f0f0;
}

.fptai-voice-dropdown .fptai-voice-option:not(:last-child) { /* Changed class name */
    border-bottom: 1px solid #eee;
}

.fptai-voice-dropdown .fptai-voice-sample-button { /* Changed class name */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    color: #333;
}

.fptai-voice-dropdown .fptai-voice-sample-button:focus { /* Changed class name */
    outline: none;
}

.fptai-voice-dropdown .fptai-voice-sample-button .dashicons { /* Changed class name */
    font-size: 20px;
    color: #6495ED;
    float: right;
    line-height: 1;
    width: 20px;
    height: 20px;
}

/* Download Buttons */
.fptai-download-buttons { /* Changed class name */
    display: flex;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 5px;
}

.fptai-download-buttons button { /* Changed class name */
    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;
}

.fptai-download-buttons .download-audio { /* Changed class name */
    background-color: #4CAF50;
    color: white;
}

.fptai-download-buttons .download-text { /* Changed class name */
    background-color: #2196F3;
    color: white;
}

.fptai-download-buttons button:hover { /* Changed class name */
    opacity: 0.9;
    transform: translateY(-1px);
}

.fptai-download-buttons button:active { /* Changed class name */
    transform: translateY(0);
}

.fptai-download-buttons .dashicons { /* Changed class name */
    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;
}

/* Responsive Styles */
@media (max-width: 600px) {
    .fptai-tts-dropdown { /* Changed class name */
        width: 100%;
    }

    .fptai-voice-dropdown .fptai-voice-options-container { /* Changed class name */
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
    }

    .fptai-voice-dropdown.active .fptai-voice-selector-display { /* Changed class name */
        border-radius: 4px 4px 0 0;
    }

    .fptai-voice-dropdown .fptai-voice-selector-display { /* Changed class name */
        border-radius: 4px;
    }

    .fptai-download-buttons { /* Changed class name */
        flex-direction: column;
    }

    .fptai-download-buttons button { /* Changed class name */
        width: 100%;
    }
}

/* Loading States */
.processing {
    opacity: 0.7;
}

/* Scrollbar Styling */
#fptai-tts-generation-history::-webkit-scrollbar { /* Changed ID name */
    width: 6px;
}

#fptai-tts-generation-history::-webkit-scrollbar-track { /* Changed ID name */
    background: #f1f1f1;
}

#fptai-tts-generation-history::-webkit-scrollbar-thumb { /* Changed ID name */
    background: #888;
    border-radius: 3px;
}

#fptai-tts-generation-history::-webkit-scrollbar-thumb:hover { /* Changed ID name */
    background: #555;
}