/* =========================================
   GOOGLE GEMINI TTS - MAIN STYLE (V10.0)
   ========================================= */

/* --- CONTAINER --- */
.ggt-container { 
    background: #fff; 
    border: 1px solid #e0e0e0; 
    border-radius: 12px; 
    padding: 20px; 
    font-family: 'Be Vietnam Pro', sans-serif; 
    position: relative; 
}

/* --- HEADER --- */
.ggt-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 15px; 
}
.ggt-header-left { display: flex; align-items: center; gap: 15px; }
.ggt-title { font-size: 18px; font-weight: bold; color: #333; display: flex; align-items: center; gap: 5px; }
.ggt-header-right { display: flex; align-items: center; gap: 10px; }
.ggt-credits { font-size: 14px; color: #666; }

/* --- MODEL SELECTOR & TOOLTIPS --- */
.ggt-model-select { display: flex; gap: 15px; margin-bottom: 15px; }
.ggt-radio-label { flex: 1; cursor: pointer; position: relative; } 
.ggt-radio-label input { display: none; }
.ggt-radio-box { 
    border: 1px solid #ddd; 
    padding: 12px; 
    border-radius: 8px; 
    text-align: center; 
    color: #666; 
    transition: 0.3s; 
    font-weight: 500; 
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.ggt-radio-label input:checked + .ggt-radio-box { 
    border-color: #4285F4; 
    background: #f0f7ff; 
    color: #4285F4; 
    font-weight: bold; 
    box-shadow: 0 0 0 1px #4285F4 inset; 
}

/* Tooltip Text */
.ggt-tooltip-text {
    visibility: hidden; width: 220px; background-color: #333; color: #fff; text-align: center;
    border-radius: 6px; padding: 8px; position: absolute; z-index: 100;
    bottom: 125%; left: 50%; margin-left: -110px; opacity: 0; transition: opacity 0.3s;
    font-size: 12px; font-weight: normal; box-shadow: 0 4px 10px rgba(0,0,0,0.2); pointer-events: none;
    line-height: 1.4;
}
.ggt-radio-label:hover .ggt-tooltip-text { visibility: visible; opacity: 1; }
.ggt-tooltip-text::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid; border-color: #333 transparent transparent transparent;
}

/* --- RATE INFO --- */
#ggt-current-rate { 
    text-align: center; 
    font-size: 13px; 
    color: #4285F4; 
    margin-bottom: 20px; 
    background: #f0f9ff; 
    padding: 8px; 
    border-radius: 4px; 
    border: 1px dashed #4285F4; 
}

/* --- FORM GRID --- */
.ggt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.ggt-label { font-weight: 600; display: block; margin-bottom: 5px; font-size: 14px; color: #444; }
.ggt-select { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #ddd; height: 42px; }
.ggt-input { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #ddd; box-sizing: border-box; font-family: inherit; margin-bottom: 15px; }
.ggt-textarea { width: 100%; padding: 15px; border-radius: 8px; border: 1px solid #ddd; margin-bottom: 10px; box-sizing: border-box; min-height: 120px; font-family: inherit; }
.ggt-input:focus, .ggt-textarea:focus { border-color: #4285F4; outline: none; }

/* --- BUTTONS --- */
/* Nút Tạo Giọng */
.ggt-btn { 
    background: #4285F4; color: white; border: none; padding: 12px 30px; 
    border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; 
}
.ggt-btn:hover { background: #3367d6; transform: translateY(-2px); }
.ggt-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* Nút Header */
.ggt-guide-btn { display:inline-flex; align-items:center; gap:5px; background:#f0f0f1; color:#333; padding:4px 10px; border-radius:15px; font-size:12px; font-weight:500; text-decoration:none; border:1px solid #ccc; }
.ggt-buy-btn { background:#ff9800; color:white; padding:5px 15px; border-radius:20px; text-decoration:none; font-size:12px; font-weight:bold; white-space:nowrap; margin-left:10px; }

/* Nút Play/Preview (FIX MÀU & ICON) */
.ggt-icon-btn {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 42px !important; height: 42px !important;
    border-radius: 6px !important;
    background: #4285F4 !important;
    border: 1px solid #4285F4 !important;
    color: white !important;
    cursor: pointer; margin-left: 5px; flex-shrink: 0;
    padding: 0 !important;
}
.ggt-icon-btn:hover { background: #3367d6 !important; }
.ggt-icon-btn svg { width: 24px; height: 24px; fill: white; }

/* --- HISTORY & CARDS --- */
.ggt-history-area { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; }
.ggt-card { background: #f9f9f9; border: 1px solid #eee; border-radius: 8px; padding: 15px; margin-bottom: 15px; }

/* Nút Mini (Tải/Video) - FIX WRAPPING */
.ggt-actions {
    display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.ggt-mini-btn { 
    padding: 6px 12px; font-size: 12px; border-radius: 4px; border: 1px solid #ddd; 
    background: #fff; cursor: pointer; text-decoration: none !important; color: #333; 
    display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
    white-space: nowrap !important; /* Chống xuống dòng chữ */
}
.ggt-mini-btn:hover { border-color: #4285F4; color: #4285F4; text-decoration: none !important; }

/* --- MODAL --- */
.ggt-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 99999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); display: none; }
.ggt-modal-content { background: #fff; padding: 30px; border-radius: 16px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.3); position: relative; animation: slideUp 0.3s ease; }
.ggt-modal-btn { background: #4285F4; color: #fff; border: none; padding: 10px 30px; border-radius: 50px; font-weight: 700; cursor: pointer; margin-top: 15px; }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* =========================================
   MOBILE RESPONSIVE (OPTIMIZATION V10)
   ========================================= */
@media (max-width: 600px) {
    /* 1. Header: Xếp dọc */
    .ggt-header {
        flex-direction: column !important; align-items: flex-start !important; gap: 10px !important;
    }
    .ggt-header-left, .ggt-header-right {
        width: 100% !important; justify-content: space-between !important;
    }

    /* 2. Model Selector: Xếp dọc (Fix lỗi input_file_104) */
    .ggt-model-select {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .ggt-radio-box {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Tooltip trên mobile đẩy xuống dưới để không bị che */
    .ggt-tooltip-text { bottom: auto; top: 100%; left: 0; margin-left: 0; width: 100%; z-index: 999; }

    /* 3. Form Grid: 1 cột */
    .ggt-grid { grid-template-columns: 1fr !important; }

    /* 4. History Actions (Fix lỗi input_file_105) */
    .ggt-actions {
        justify-content: flex-end !important;
    }
    /* Đảm bảo nút không bị co chữ */
    .ggt-mini-btn {
        flex: 1 1 auto; /* Tự co giãn nhưng giữ nguyên nội dung */
        justify-content: center;
        max-width: 120px; /* Giới hạn chiều rộng nếu cần */
    }
}