/* ==========================================================================
   FILE: css/style.css
   DESCRIPTION: Chứa style chung cho Nút bấm, Menu, Ô tìm kiếm và Sub-menu
   ========================================================================== */

/* --- 1. DROPDOWN MENU CHUNG (Dùng cho cả Header và Index) --- */
.dropdown { 
    position: relative; 
    display: inline-block; 
}

.dropdown-content {
    display: none; 
    position: absolute; 
    background-color: #fff;
    min-width: 160px; 
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100; 
    border-radius: 4px; 
    top: 100%; 
    left: 0;
    border: 1px solid #eee;
    
    /* QUAN TRỌNG: Để menu con (Submenu) có thể hiển thị ra ngoài khung cha */
    overflow: visible !important; 
}

.dropdown-content a {
    color: #333; 
    padding: 10px 16px; 
    text-decoration: none;
    display: block; 
    font-size: 0.9rem; 
    transition: background 0.2s;
}

.dropdown-content a:hover { 
    background-color: #f1f1f1; 
    color: #007bff; 
}

.dropdown:hover .dropdown-content { 
    display: block; 
}

/* --- 2. SKILL TABS (Các nút bấm Listening, Reading...) --- */
.skill-tabs {
    display: flex;
    align-items: center;
    gap: 5px; /* Khoảng cách giữa các nút */
    flex-wrap: wrap;
}

.skill-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    
    /* TRẠNG THÁI MẶC ĐỊNH */
    background: #ffffff;
    color: #444444;       
    border: 1px solid #ffc107 !important; /* Viền Vàng Gold mặc định */
    border-radius: 6px;
    
    /* HIỆU ỨNG CHUYỂN ĐỘNG */
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);

    /* KÍCH THƯỚC CHUẨN 30PX */
    padding: 0 12px !important;     
    font-size: 0.9rem !important;  
    font-weight: 700 !important;
    height: 39px !important;        
    min-width: auto !important;
}

/* HIỆU ỨNG KHI RÊ CHUỘT (HOVER) */
.skill-tab:hover {
    background-color: #fff0f5 !important; /* Nền hồng phấn */
    border-color: #ffb6c1 !important;     /* Viền hồng nhẹ */
    transform: scale(1.05);               /* Phóng to */
    box-shadow: 0 4px 8px rgba(255, 182, 193, 0.5); /* Đổ bóng hồng */
    color: #444444 !important;            /* Giữ nguyên màu chữ */
}

/* Icon bên trong nút */
.skill-tab i {
    margin-right: 6px;
    color: #555; 
    transition: none; 
}
.skill-tab:hover i {
    color: #555 !important; 
}

/* TRẠNG THÁI ĐANG CHỌN (ACTIVE) */
.skill-tab.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
    transform: scale(1);
    box-shadow: none;
}
.skill-tab.active i {
    color: white !important;
}

/* --- 3. SEARCH FORM (Ô tìm kiếm) --- */
.search-form {
    display: flex;
    align-items: stretch; /* Ép chiều cao bằng nhau */
    height: 39px !important; 
    margin: 0;
    box-sizing: border-box;
}

.search-form input {
    height: 100% !important; 
    margin: 0 !important;
    line-height: normal !important; 
    box-sizing: border-box !important;
    width: 170px;
    padding: 0 10px !important;
    font-size: 0.9rem !important;
    border: 1px solid #ccc !important;
    border-right: none !important; 
    border-radius: 4px 0 0 4px !important;
    outline: none;
}

.search-form input:focus {
    border-color: #007bff !important;
    border-right: 1px solid #007bff !important;
}

.search-form button {
    height: 100% !important; 
    margin: 0 !important;
    box-sizing: border-box !important;
    width: 39px !important;  
    padding: 0 !important;
    background: #007bff !important;
    color: white !important;
    border: 1px solid #007bff !important; /* Viền giả để khớp kích thước input */
    border-radius: 0 4px 4px 0 !important;
    cursor: pointer;
    display: flex !important;             
    align-items: center;
    justify-content: center;
}

.search-form button:hover {
    background: #0056b3 !important;
    border-color: #0056b3 !important;
}

/* --- 4. MULTI-LEVEL SUBMENU (Menu đa cấp cho Header) --- */

/* Class bao quanh mục có menu con */
.submenu-parent {
    position: relative; 
}

/* Mũi tên chỉ hướng trong menu */
.submenu-parent > a i.arrow-icon {
    float: right; 
    margin-top: 3px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Khung chứa menu con */
.submenu {
    display: none; /* Ẩn mặc định */
    position: absolute;
    top: 0;
    width: 210px; /* Độ rộng menu con */
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    border: 1px solid #eee;
    z-index: 101;
}

/* Style cho các link trong menu con */
.submenu a {
    font-size: 0.9rem !important;
    padding: 10px 15px !important;
}

/* Hiển thị menu con khi rê chuột */
.submenu-parent:hover > .submenu {
    display: block;
}

/* Hover vào mục cha thì đổi màu để biết đang chọn */
.submenu-parent:hover > a {
    background-color: #f8f9fa;
    color: #007bff !important;
}

/* --- VỊ TRÍ HIỂN THỊ MENU CON --- */

/* Hiện bên TRÁI (cho IELTS) */
.submenu-left {
    right: 100%; 
    margin-right: 0; 
    border-right: none;
}

/* Hiện bên PHẢI (cho PET) */
.submenu-right {
    left: 100%; 
    margin-left: 0;
}