/**
 * Job Dashboard Top Jobs Ranking Styles
 * Version: 1.0.0
 * Features: Top jobs list, applicants modal, responsive design
 */

/* CSS Variables */
:root {
    --kasikorn-primary: #138F2E;
    --kasikorn-secondary: #0F5F28;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-light: #e0e0e0;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

/* Container */
.job_dash_container_yzb567 {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

/* Header */
.job_dash_header_abc890 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.job_dash_header_abc890 h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Period Selector */
.job_dash_period_selector_def123 {
    display: flex;
    gap: 10px;
}

.job_dash_period_btn_ghi456 {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.job_dash_period_btn_ghi456:hover {
    background: var(--bg-light);
    border-color: var(--kasikorn-primary);
}

.job_dash_period_btn_ghi456.active {
    background: var(--kasikorn-primary);
    color: white;
    border-color: var(--kasikorn-primary);
}

/* Top Jobs List */
.job_dash_topjobs_list_def678 {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 25px;
    min-height: 400px;
}

/* Job Item */
.job_dash_topjob_item_ghi901 {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.job_dash_topjob_item_ghi901::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--kasikorn-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.job_dash_topjob_item_ghi901:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 15px rgba(19, 143, 46, 0.15);
}

.job_dash_topjob_item_ghi901:hover::before {
    transform: scaleY(1);
}

.job_dash_topjob_item_ghi901::after {
    content: '→';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 20px;
    color: var(--kasikorn-primary);
}

.job_dash_topjob_item_ghi901:hover::after {
    opacity: 1;
}

.job_dash_topjob_item_ghi901:last-child {
    margin-bottom: 0;
}

/* Rank Number */
.job_dash_topjob_rank_jkl234 {
    width: 45px;
    height: 45px;
    background: var(--kasikorn-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    margin-right: 20px;
    flex-shrink: 0;
}

/* Top 3 Special Colors */
.job_dash_topjob_item_ghi901:nth-child(1) .job_dash_topjob_rank_jkl234 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--text-primary);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4);
}

.job_dash_topjob_item_ghi901:nth-child(2) .job_dash_topjob_rank_jkl234 {
    background: linear-gradient(135deg, #C0C0C0 0%, #B8B8B8 100%);
    color: var(--text-primary);
    box-shadow: 0 3px 10px rgba(192, 192, 192, 0.4);
}

.job_dash_topjob_item_ghi901:nth-child(3) .job_dash_topjob_rank_jkl234 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(205, 127, 50, 0.4);
}

/* Job Info */
.job_dash_topjob_info_mno567 {
    flex: 1;
    min-width: 0;
}

.job_dash_topjob_name_pqr890 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job_dash_topjob_count_stu123 {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Progress Bar - แก้ไขเพื่อรองรับการแสดงจำนวนผู้สมัคร */
.job_dash_topjob_progress_vwx456 {
    width: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 40px;
}

/* เปลี่ยนจาก percentage เป็น applicant count */
.job_dash_topjob_percentage_yzb789 {
    font-size: 16px;
    font-weight: 700;
    color: var(--kasikorn-primary);
    margin-bottom: 8px;
    text-align: right;
    min-width: 80px;
}

.job_dash_topjob_bar_abc012 {
    width: 100%;
    height: 8px;
    background: rgba(19, 143, 46, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.job_dash_topjob_fill_def345 {
    height: 100%;
    background: linear-gradient(90deg, var(--kasikorn-primary) 0%, var(--kasikorn-secondary) 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
    box-shadow: 0 2px 4px rgba(19, 143, 46, 0.2);
}

/* Loading State */
.job_dash_loading_ghi901 {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Empty State */
.job_dash_empty_state_ghi678 {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.job_dash_empty_icon_jkl901 {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.job_dash_empty_state_ghi678 p {
    font-size: 16px;
    margin: 0;
}

/* ========================================
   MODAL STYLES
   ======================================== */

/* Modal Overlay */
.job_modal_overlay_rst456 {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.job_modal_overlay_rst456.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.job_modal_content_uvw789 {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

/* Modal Header */
.job_modal_header_xyz012 {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.job_modal_title_abc345 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.job_modal_close_def678 {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 50%;
}

.job_modal_close_def678:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Search Section */
.job_modal_search_ghi901 {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

.job_search_input_jkl234 {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.job_search_input_jkl234:focus {
    outline: none;
    border-color: var(--kasikorn-primary);
    box-shadow: 0 0 0 3px rgba(19, 143, 46, 0.1);
}

.job_search_btn_mno567,
.job_clear_btn_pqr890 {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.job_search_btn_mno567 {
    background: var(--kasikorn-primary);
    color: white;
}

.job_search_btn_mno567:hover {
    background: var(--kasikorn-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(19, 143, 46, 0.3);
}

.job_clear_btn_pqr890 {
    background: #e0e0e0;
    color: #666;
}

.job_clear_btn_pqr890:hover {
    background: #ccc;
    transform: translateY(-2px);
}

/* Modal Body */
.job_modal_body_stu123 {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #fafbfc;
}

/* Custom Scrollbar */
.job_modal_body_stu123::-webkit-scrollbar {
    width: 8px;
}

.job_modal_body_stu123::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.job_modal_body_stu123::-webkit-scrollbar-thumb {
    background: var(--kasikorn-primary);
    border-radius: 4px;
}

.job_modal_body_stu123::-webkit-scrollbar-thumb:hover {
    background: var(--kasikorn-secondary);
}

/* ========================================
   APPLICANT CARDS
   ======================================== */

/* Applicant Card */
.job_applicant_card_abc234 {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid var(--kasikorn-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.job_applicant_card_abc234::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(19, 143, 46, 0.05) 0%, transparent 100%);
    border-radius: 0 0 0 120px;
}

.job_applicant_card_abc234:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(19, 143, 46, 0.15);
    border-left-width: 8px;
}

/* Applicant Header Section */
.job_applicant_header_def567 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.job_applicant_info_wrapper_abc789 {
    flex: 1;
    min-width: 0;
}

.job_applicant_name_ghi890 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.job_applicant_name_icon_def123 {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--kasikorn-primary) 0%, var(--kasikorn-secondary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(19, 143, 46, 0.3);
    flex-shrink: 0;
}

.job_applicant_contact_jkl456 {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.job_contact_item_mno789 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.job_contact_icon_pqr012 {
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--kasikorn-primary);
}

.job_contact_value_stu345 {
    color: #333;
    font-weight: 500;
}

.job_contact_value_stu345.email {
    color: #0066cc;
    text-decoration: none;
    transition: var(--transition);
}

.job_contact_value_stu345.email:hover {
    text-decoration: underline;
    color: var(--kasikorn-primary);
}

/* Job Number Badge */
.job_applicant_no_jkl123 {
    background: linear-gradient(135deg, var(--kasikorn-primary) 0%, var(--kasikorn-secondary) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(19, 143, 46, 0.3);
    white-space: nowrap;
    margin-bottom: 10px;
}

/* Date Badge */
.job_date_badge_pqr789 {
    background: #f0f0f0;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* Salary Highlight Section */
.job_salary_highlight_def567 {
    background: linear-gradient(135deg, #fff9f0 0%, #fffbf5 100%);
    border: 1px solid #ffd4a3;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.job_salary_item_ghi890 {
    flex: 1;
    text-align: center;
}

.job_salary_label_jkl123 {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.job_salary_amount_mno456 {
    font-size: 20px;
    font-weight: 700;
    color: var(--kasikorn-primary);
}

/* Applicant Details Grid */
.job_applicant_details_mno456 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.job_detail_group_vwx678 {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.job_detail_group_title_yzb901 {
    font-size: 12px;
    font-weight: 700;
    color: var(--kasikorn-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.job_detail_item_pqr789 {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.job_detail_item_pqr789:last-child {
    margin-bottom: 0;
}

.job_detail_label_stu012 {
    font-weight: 600;
    color: #666;
    margin-right: 8px;
    min-width: 100px;
}

.job_detail_value_abc234 {
    color: #333;
    flex: 1;
}

/* ========================================
   PAGINATION
   ======================================== */

/* Pagination Container */
.job_modal_footer_vwx456 {
    padding: 20px 25px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    background: white;
    border-radius: 0 0 16px 16px;
}

.job_pagination_yzb789 {
    display: flex;
    gap: 8px;
    align-items: center;
}

.job_page_btn_abc345 {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    min-width: 40px;
    text-align: center;
}

.job_page_btn_abc345:hover {
    background: var(--bg-light);
    border-color: var(--kasikorn-primary);
    transform: translateY(-2px);
}

.job_page_btn_abc345.active {
    background: var(--kasikorn-primary);
    color: white;
    border-color: var(--kasikorn-primary);
    box-shadow: 0 3px 10px rgba(19, 143, 46, 0.3);
}

.job_page_btn_abc345:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.job_page_btn_abc345:disabled:hover {
    background: white;
    border-color: #ddd;
}

/* ========================================
   STATES
   ======================================== */

/* Loading State */
.job_modal_loading_def678 {
    text-align: center;
    padding: 80px 20px;
    color: var(--kasikorn-primary);
}

.job_modal_loading_def678::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 30px auto 0;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--kasikorn-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty State */
.job_modal_empty_ghi901 {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.job_modal_empty_ghi901 .empty_icon {
    font-size: 100px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.job_modal_empty_ghi901 .empty_text {
    font-size: 18px;
    font-weight: 500;
    color: #666;
}

/* Retry Button */
.job_retry_btn {
    margin-top: 20px;
    padding: 10px 30px;
    background: var(--kasikorn-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.job_retry_btn:hover {
    background: var(--kasikorn-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(19, 143, 46, 0.3);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    /* Header */
    .job_dash_header_abc890 {
        flex-direction: column;
        align-items: stretch;
    }
    
    .job_dash_period_selector_def123 {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .job_dash_period_btn_ghi456 {
        flex: 1;
        min-width: 70px;
    }
    
    /* Top Jobs */
    .job_dash_topjob_item_ghi901 {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px 10px;
    }
    
    .job_dash_topjob_rank_jkl234 {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-right: 15px;
    }
    
    .job_dash_topjob_progress_vwx456 {
        width: 100%;
        align-items: flex-start;
        margin-right: 0;
    }
    
    /* ปรับขนาดการแสดงจำนวนผู้สมัครในมือถือ */
    .job_dash_topjob_percentage_yzb789 {
        font-size: 14px;
        min-width: 70px;
    }
    
    /* Modal */
    .job_modal_content_uvw789 {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .job_modal_header_xyz012 {
        padding: 15px 20px;
    }
    
    .job_modal_title_abc345 {
        font-size: 18px;
    }
    
    /* Search */
    .job_modal_search_ghi901 {
        flex-direction: column;
        padding: 15px 20px;
    }
    
    .job_search_input_jkl234 {
        width: 100%;
    }
    
    .job_search_btn_mno567,
    .job_clear_btn_pqr890 {
        width: 100%;
    }
    
    /* Applicant Cards */
    .job_applicant_header_def567 {
        flex-direction: column;
        gap: 15px;
    }
    
    .job_applicant_name_ghi890 {
        font-size: 18px;
    }
    
    .job_applicant_contact_jkl456 {
        flex-direction: column;
        gap: 10px;
    }
    
    .job_applicant_no_jkl123 {
        align-self: flex-start;
    }
    
    /* Salary Section */
    .job_salary_highlight_def567 {
        flex-direction: column;
        gap: 15px;
    }
    
    .job_salary_amount_mno456 {
        font-size: 18px;
    }
    
    /* Details Grid */
    .job_applicant_details_mno456 {
        grid-template-columns: 1fr;
    }
    
    /* Pagination */
    .job_pagination_yzb789 {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .job_page_btn_abc345 {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 35px;
    }
}

@media (max-width: 480px) {
    .job_dash_container_yzb567 {
        padding: 15px;
    }
    
    .job_dash_header_abc890 h2 {
        font-size: 20px;
    }
    
    .job_dash_topjobs_list_def678 {
        padding: 15px;
    }
    
    .job_modal_body_stu123 {
        padding: 15px;
    }
    
    .job_applicant_card_abc234 {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .job_modal_overlay_rst456 {
        position: static;
        background: none;
    }
    
    .job_modal_content_uvw789 {
        box-shadow: none;
        max-height: none;
    }
    
    .job_modal_close_def678,
    .job_modal_search_ghi901,
    .job_modal_footer_vwx456 {
        display: none;
    }
    
    .job_applicant_card_abc234 {
        page-break-inside: avoid;
    }
}