/**
 * CHENIBA Staff Hire - Frontend Stylesheet
 *
 * This file contains all the structural and layout styles for the plugin's
 * frontend components. Branding (colors, fonts) is applied dynamically
 * from the Global Settings panel.
 *
 * @package CHENIBA_Staff_Hire
 */

/* ==========================================================================
   1. Global & Shared Styles
   ========================================================================== */

/* Base style for all primary buttons */
.cheniba-btn {
    background-color: #000000;
    color: #D9C2C0;
    border: none;
    padding: 12px 28px;
    cursor: pointer;
    font-size: 1.1em;
    font-family: 'Cormorant Garamond', serif; /* Default font stack */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Click animation for buttons */
.cheniba-btn:active,
.cheniba-submit-filter-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Shared style for text inputs */
.cheniba-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    font-family: sans-serif;
}

/* Shared style for textareas */
.cheniba-textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white !important;
    color: #333;
    font-family: sans-serif;
    min-height: 100px;
}

/* AJAX Form Response Messages */
.cheniba-form-response {
    margin-top: 1em;
    padding: 1em;
    border-radius: 5px;
    text-align: center;
    display: none;
}
.cheniba-form-response.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.cheniba-form-response.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* ==========================================================================
   2. Role Listings & Search Results
   ========================================================================== */

.cheniba-role-listings-container {
    display: grid;
    /* Creates responsive columns that are at least 300px wide */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding: 2.5em;
    border-radius: 12px;
}

.cheniba-category-title {
    font-weight: 500;
    margin-bottom: 1em;
    border-bottom: 1px solid rgba(217, 194, 192, 0.2);
    padding-bottom: 0.5em;
}

.cheniba-role-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cheniba-role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.cheniba-role-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.cheniba-role-title-wrapper a {
    text-decoration: none;
    font-size: 1.1em;
}

.cheniba-read-more-btn {
    text-decoration: none;
    font-size: 0.9em;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.cheniba-role-item:hover .cheniba-read-more-btn {
    opacity: 1; /* Show on hover */
}

.cheniba-no-results {
    text-align: center;
    padding: 2em;
}


/* ==========================================================================
   3. Filter Bar
   ========================================================================== */

.cheniba-filter-bar-container {
    padding: 2.5em;
    border-radius: 12px;
}

.cheniba-filter-form .cheniba-filter-groups-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 2.5em;
}

.cheniba-notes-section, .cheniba-user-email-group {
    max-width: 700px;
    margin: 0 auto 2em auto;
}

.cheniba-notes-section label, .cheniba-user-email-group label {
    display: block;
    text-align: center;
    margin-bottom: 1em;
    font-size: 1.4em;
}

.cheniba-submit-wrapper {
    text-align: center;
}

.cheniba-submit-filter-btn {
    background-color: #000000;
    padding: 15px 40px;
    font-size: 1.2em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cheniba-submit-filter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}


/* ✅ NEW: Custom Searchable Dropdown Styles */

.cheniba-custom-select-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

.cheniba-custom-select-wrapper label {
    margin-bottom: 0.8em;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
}

.cheniba-custom-select {
    position: relative;
    width: 100%;
    text-align: left;
    outline: none;
}

.cheniba-custom-select .select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #fff;
    color: #333;
    border-radius: 50px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.cheniba-custom-select .arrow {
    position: relative;
    height: 10px;
    width: 10px;
    margin-left: 15px;
}

.cheniba-custom-select .arrow::before, .cheniba-custom-select .arrow::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 2px;
    height: 100%;
    background-color: #555;
    transition: all 0.3s ease;
}

.cheniba-custom-select .arrow::before {
    transform: rotate(-45deg);
}

.cheniba-custom-select .arrow::after {
    left: 6px;
    transform: rotate(45deg);
}

.cheniba-custom-select.open .arrow::before { transform: rotate(45deg); }
.cheniba-custom-select.open .arrow::after { transform: rotate(-45deg); }

.cheniba-custom-select .custom-options {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: #171137;
    border: 1px solid rgba(217, 194, 192, 0.3);
    border-radius: 12px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.cheniba-custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option-search {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(217, 194, 192, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: sans-serif;
}

.options-list {
    max-height: 200px; /* Limits height to show approx 5 items */
    overflow-y: auto;
}

.custom-option {
    position: relative;
    display: block;
    padding: 12px 15px;
    color: #D9C2C0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   4. Popup Form Modal
   ========================================================================== */

.cheniba-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* The blur effect is applied dynamically */
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cheniba-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.cheniba-popup-modal {
    padding: 2em 2.5em;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cheniba-popup-overlay.is-visible .cheniba-popup-modal {
    transform: scale(1);
}

.cheniba-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    line-height: 1;
    color: inherit;
}

.cheniba-contact-form .cheniba-form-field {
    margin-bottom: 1.2em;
}

.cheniba-contact-form label {
    display: block;
    margin-bottom: 0.5em;
    font-size: 0.9em;
}

.cheniba-contact-form input[type="text"],
.cheniba-contact-form input[type="email"],
.cheniba-contact-form input[type="tel"] {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    font-size: 1em;
    border: 1px solid; /* Border color is applied dynamically */
}
