



/* Clear Float */
#a-text-to-speech-box.clear {
    clear: both;
}

/* Hidden Elements */
#a-text-to-speech-box .hidden-voice {
    display: none;
}

/* Links */
#a-text-to-speech-box a {
    color: #054fcb;
    text-decoration: none;
}
#a-text-to-speech-box a:hover {
    color: blue;
    transform: translateY(-1px);
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

/* ==================================================
   2. FORM INTERFACE
   ================================================== */

/* Main Form Container */
#atts-form {
    border-radius: 5px;
    padding: 5px 10px 10px 10px;
    margin: 0px;
    display: block;
    background: #f6f6f6;
}

/* Table Layout for Form */
#a-text-to-speech-box table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    font-size: 100%;
}

#a-text-to-speech-box .td1 {
    width: 20%;
    min-width: 100px;
    vertical-align: middle;
}

#a-text-to-speech-box .td2 {
    text-align: left;
    vertical-align: middle;
}

/* Input Elements */
#a-text-to-speech-box .td2 select {
    font-size: 100%;
    min-width: 170px;
    padding: 5px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    box-sizing: border-box;
}

#a-text-to-speech-box textarea {
    display: block;
    font-size: 100%;
    width: 100%;
    min-height: 130px;
    padding: 5px;
    margin: 4px 0;
    border: 2px solid #f6f6f6;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: -3px;
    transition: border-color 0.3s 
ease;
}

#a-text-to-speech-box textarea:focus{
    outline: none;
    border-color: #054fcb;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
}


#a-text-to-speech-box .atts-form-group {
    padding: 0;
    margin-bottom: 10px;
}
#a-text-to-speech-box .atts-form-group p {
    margin: 0;
    padding: 0;
}

#a-text-to-speech-box .voice-options {
    padding: 0;
}
#a-text-to-speech-box .voice-select {
    background: #ececec;
    margin: 2px;
    padding: 0 5px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
}

#a-text-to-speech-box .atts-female-voice {
    color: #d72a61 !important;
    font-weight: 500;
}
#a-text-to-speech-box .atts-female-voice input[type="radio"] {
    accent-color: #d72a61;
}
#a-text-to-speech-box .atts-female-voice label {
    color: #d72a61 !important;
    font-weight: 500;
}
#a-text-to-speech-box .atts-male-voice {
    color: #054fcb;
    font-weight: 500;
}
#a-text-to-speech-box .atts-male-voice input[type="radio"] {
    accent-color: #054fcb;
}
#a-text-to-speech-box .atts-male-voice label {
    color: #054fcb !important;
    font-weight: 500;
}


/* Radio Buttons and Checkboxes */
#a-text-to-speech-box .td2 input[type="checkbox"] {
    vertical-align: middle;
    margin-right: 5px;
}

#a-text-to-speech-box input[type="radio"] {
    vertical-align: middle;
    margin-right: 5px;
}

#a-text-to-speech-box .td2 input[type="radio"] {
    margin-right: 0 !important;
}

#a-text-to-speech-box .radio-type {
    vertical-align: middle;
    font-size: 70% !important;
}

#atts-form .radio-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

/* Labels */
#a-text-to-speech-box label {
    font-size: 90%;
    margin-right: 0;
}

#a-text-to-speech-box .td2 input[type="radio"] + label {
    margin-right: 0;
}

/* Form Element Hover Effects */
#a-text-to-speech-box input[type="radio"]:hover,
#a-text-to-speech-box input[type="checkbox"]:hover,
#a-text-to-speech-box select:hover {
    cursor: pointer;
    outline: none;
    border-color: #999;
}

/* Character Count */
#atts-char-count {
    font-size: 80%;
    position: relative;
    top: 0px;
}

/* ==================================================
   3. BUTTON SYSTEM
   ================================================== */

/* Primary Form Submit Button */
#a-text-to-speech-box .atts-form button {
    background-color: #3c4145;
    color: #e9eae9;
    line-height: 1.4;
    padding: 2px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 100%;
    text-shadow: 0 0 0 transparent;
    transition: all 0.2s ease;
}

#a-text-to-speech-box .atts-form button:hover {
    color: #fff;
    background: #4353ff;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px); /* Nâng nút lên 1px */
}

#a-text-to-speech-box .create-speech-icon {
    font-size: 0;
    fill: currentColor;
    vertical-align: middle;
}


/* Voice Options Button */
#a-text-to-speech-box .atts-show-more button {
    background: none;
    color: #054fcb;
    border: none;
}
#a-text-to-speech-box .atts-show-more button:hover {
    background: none;
    color: #054fcb;
    border: none;
}


#a-text-to-speech-box .advanced-options {
    display: none;
}

#a-text-to-speech-box .show-advanced-options,
#a-text-to-speech-box .hide-advanced-options {
    margin: 10px 0;
    cursor: pointer;
    color: #007bff;
    text-align: right;
}

/* Reset Options */
#a-text-to-speech-box .reset-all-options {
    text-align: right;
    padding: 10px;
    font-size: 80%;
}

#a-text-to-speech-box .reset-all-options a {
    opacity: 0.6;
    display: inline-block;
}

/* ==================================================
   8. LOADING STATES
   ================================================== */

#a-text-to-speech-box .loading-container {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

#a-text-to-speech-box .loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 2s linear infinite;
    margin: 5px 5px 5px 0;
}

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

/* ==================================================
   9. AUDIO & DOWNLOAD COMPONENTS
   ================================================== */

#atts-audio {
    margin-top: 20px;
    width: 100%;
}

#atts-download {
    margin-top: 20px;
    display: none;
    text-align: center;
}



#a-text-to-speech-box .speech-output {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 10px 0;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #f3f3f3;
}

#a-text-to-speech-box .speech-output button {
    font-size: 90%;
    height: 20px;
}

#a-text-to-speech-box .speech-output-success {
    flex: 1;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#a-text-to-speech-box .speech-output-success p {
    margin-bottom: 0 !important;
}

#a-text-to-speech-box .speech-output-success {
    
}
#a-text-to-speech-box .success-icon {
    color: green;
    width: 14px;
    font-size: 13px;
    fill: currentColor;
    vertical-align: middle;
}

#a-text-to-speech-box .success-text {
    color: green;
}

#a-text-to-speech-box .speech-text-display {
    font-weight: bold;
}


#a-text-to-speech-box .speech-action-button-container {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

#a-text-to-speech-box .speech-output-play-button,
#a-text-to-speech-box .speech-output-download-button {
    text-align: center;
}


/* ==================================================
   6. SPEECH HISTORY SECTION
   ================================================== */
#a-text-to-speech-box .speech-history {
    padding-bottom: 10px;
}

#a-text-to-speech-box .speech-history h3 {
    font-size: 100%;
    font-weight: normal;
    margin-top: 10px;
}

#a-text-to-speech-box .speech-history .speech-list-wrap {
    margin: -10px;
    padding: 10px 0;
}

#a-text-to-speech-box .speech-history .speech-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #f0f0f0;
    overflow: hidden;
    background: #fff;
}

#a-text-to-speech-box .speech-history .speech-item {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

#a-text-to-speech-box .speech-history .speech-item:last-child {
    border-bottom: none;
}

#a-text-to-speech-box .speech-history .speech-item:hover {
    background-color: #f8f9fa;
}

#a-text-to-speech-box .speech-history .title-col {
    flex: 1;
    text-align: left;
}

#a-text-to-speech-box .speech-history .speech-title {
    color: #3c4147;
    font-size: 95%;
    font-weight: normal;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#a-text-to-speech-box .speech-history .action-button-container-col {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

#a-text-to-speech-box .speech-history .play-col,
#a-text-to-speech-box .speech-history .share-col,
#a-text-to-speech-box .speech-history .download-col {
    flex: 0 0 auto;
}

/* Textarea error state */
#a-text-to-speech-box textarea.atts-textarea-error,
#a-text-to-speech-box textarea.atts-textarea-error:focus {
    outline: none;
    border-color: #ff0019 !important;
    box-shadow: 0 0 0 4px rgba(237, 30, 11, 0.232);
    transition: border-color 0.3s;
}


/* ==================================================
   7. ADVANCED OPTIONS & SETTINGS
   ================================================== */



@media (max-width:  960px) {
	
	/*Giao dien mibile*/

    #a-text-to-speech-box .td1 {
        width: 20%;
        min-width: 80px;
    }

    #a-text-to-speech-box .speech-output button {
        font-size: 100% !important;
    }

    #a-text-to-speech-box .speech-output {
        margin: 5px 0 !important;
        padding: 10px 5px !important;
    }

    #a-text-to-speech-box .speech-output-success {
        -webkit-line-clamp: 6!important;
        font-size: 95% !important;
        line-height: 1.4 !important;
    }
    #a-text-to-speech-box .success-text {
        display: none !important;
    }

    /* Bắt đầu css play audio touch */
	#a-text-to-speech-box .speech-history .atts-button-play,
    #a-text-to-speech-box .speech-history .atts-button-play-error {
		width: 35px !important;
		height: 35px !important;
	}
	#a-text-to-speech-box .speech-history .atts-icon-play,
    #a-text-to-speech-box .speech-history .atts-icon-pause {
		width: 16px !important;
		height: 16px !important;
	}
	/* Kết thúc css play audio touch */
}