/**
 * Fincy TJM Frontend Styles
 * 
 * @package Fincy_TJM
 * @version 1.0.0
 */

/* =====================================================
   TJM INFO BLOC - FORCE FULL WIDTH
   ===================================================== */
.wr-tjm-type:has(.alert-info),
.form-group.wr-tjm-type:has(.alert-info) {
    flex-basis: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: 0 0 100% !important;
}

/* Fallback for browsers without :has() support */
.wr-tjm-type .alert-info {
    width: 100%;
}

/* =====================================================
   TJM CARD ICON - ENSURE ROUND BACKGROUND
   ===================================================== */
/* Force TJM card icon to have same styling as Fixed/Hourly */
.wr-li-tjm .wr-project-type i,
li.wr-li-tjm label i {
    /* Inherit all styles from Fixed card icon */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure the icon inherits parent wrapper structure if it exists */
.wr-li-tjm .wr-project-type .wr-icon-holder,
.wr-li-tjm label .wr-icon-holder {
    /* Match Fixed icon wrapper if present */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* =====================================================
   TJM Budget/Price Display
   ===================================================== */
.tjm-budget-range {
    font-weight: 700;
    color: var(--primthemecolor, #ff5851) !important;
    font-size: 24px !important;
    display: block;
    line-height: 1.2;
}

/* Override Workreap price styles for TJM */
.wr-project-box .wr-price h4:has(.tjm-budget-range),
.wr-verified-info h4:has(.tjm-budget-range) {
    font-size: 24px !important;
}

/* Force TJM price color */
h4 .tjm-budget-range,
.wr-project-price .tjm-budget-range {
    color: var(--primthemecolor, #ff5851) !important;
}

/* TJM Badge on project listings */
.tjm-project-badge {
    display: inline-block;
    background: #2271b1;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
    vertical-align: middle;
}

.tjm-project-badge i {
    margin-right: 4px;
}

/* TJM Option Card Spacing & Layout */
.nav-tabs .wr-li-tjm,
.wr-nav-tabs .wr-li-tjm,
li.wr-li-tjm {
    margin-top: 20px !important; /* Espacement au-dessus */
    width: 100% !important; /* Même largeur que les autres */
    max-width: 100% !important;
}

/* Make TJM card same size as Fixed/Hourly on desktop */
@media (min-width: 768px) {
    .nav-tabs .wr-li-tjm,
    .wr-nav-tabs .wr-li-tjm,
    li.wr-li-tjm {
        width: calc(50% - 10px) !important; /* Même largeur que Fixe/Journalier */
        margin-left: auto !important; /* Centré */
        margin-right: auto !important;
    }
}

/* TJM Fields Container - Match Workreap form style EXACTLY */
.tjm-fields-container {
    width: 100%;
    float: left;
    clear: both;
    margin-top: 20px;
}

.tjm-fields-container .form-group {
    margin-bottom: 20px;
}

.tjm-fields-container .wr-label,
.tjm-fields-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #323232;
}

.tjm-fields-container .required {
    color: #ff5851;
}

.tjm-fields-container .form-control {
    width: 100%;
    height: 50px;
    padding: 0 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #323232;
    background: #fff;
    transition: all 0.3s ease;
}

.tjm-fields-container .form-control:focus {
    border-color: var(--primthemecolor, #ff5851);
    outline: none;
}

.tjm-fields-container .form-control:disabled,
.tjm-fields-container .form-control[readonly] {
    background-color: #f8f8f8;
    cursor: not-allowed;
}

.tjm-fields-container .wr-note,
.tjm-fields-container .form-text {
    display: block;
    font-size: 12px;
    color: #767676;
    margin-top: 5px;
}

/* Alert info box - Match Workreap style */
.tjm-fields-container .alert-info,
.tjm-fields-container .wr-description-holder .alert {
    background: #f0f6fb;
    border: 1px solid #d6e9f8;
    border-left: 4px solid #5193c5;
    padding: 15px 20px;
    border-radius: 4px;
    color: #323232;
}

.tjm-fields-container .alert-info h6 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #323232;
}

.tjm-fields-container .alert-info i {
    color: #5193c5;
    margin-right: 5px;
}

.tjm-fields-container .alert-info ul {
    list-style: disc;
    margin: 10px 0 0 20px;
    padding: 0;
}

.tjm-fields-container .alert-info ul li {
    margin-bottom: 5px;
    color: #767676;
    font-size: 13px;
}

/* TJM Project Meta Box on Single Page */
.tjm-project-meta-box.wt-projectdetails {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0;
    margin: 20px 0;
}

.tjm-project-meta-box .wt-projecttitle {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.tjm-project-meta-box .wt-projecttitle h3 {
    margin: 0;
    color: #323232;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.tjm-project-meta-box .wt-projecttitle h3 i {
    margin-right: 10px;
    color: var(--primthemecolor, #ff5851);
}

.tjm-project-meta-box .wt-projectcontent {
    padding: 25px;
}

.tjm-project-details {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.tjm-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tjm-detail-item:last-child {
    border-bottom: none;
}

.tjm-detail-label {
    font-weight: 500;
    color: #767676;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.tjm-detail-label i {
    margin-right: 8px;
    color: var(--primthemecolor, #ff5851);
    font-size: 16px;
}

.tjm-detail-value {
    font-weight: 700;
    color: #323232;
    font-size: 16px;
}

.tjm-info-box {
    background: #f0f6fb;
    border: 1px solid #d6e9f8;
    border-left: 4px solid #5193c5;
    padding: 15px 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.tjm-info-box i {
    color: #5193c5;
    margin-right: 8px;
    font-size: 16px;
}

.tjm-info-box p {
    margin: 0;
    color: #767676;
    font-size: 13px;
    line-height: 1.6;
}

/* TJM Project Summary (for cards) */
.tjm-project-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.tjm-rate {
    font-weight: 700;
    color: #2271b1;
}

.tjm-separator {
    color: #ccc;
}

.tjm-budget-range {
    font-weight: 700;
    color: #2271b1;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .tjm-fields-container {
        padding: 0;
    }
    
    .tjm-project-meta-box {
        padding: 15px;
    }
    
    .tjm-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .tjm-project-summary {
        flex-wrap: wrap;
    }
    
    /* Full width on mobile */
    .nav-tabs .wr-li-tjm,
    .wr-nav-tabs .wr-li-tjm,
    li.wr-li-tjm {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* TJM Project Meta */
.tjm-project-meta {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tjm-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tjm-meta-item:last-child {
    border-bottom: none;
}

.tjm-meta-item .label {
    font-weight: 600;
    color: #333;
}

.tjm-meta-item .value {
    color: #2271b1;
    font-weight: 500;
}

/* TJM Form Styles */
.tjm-form-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.tjm-form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2271b1;
    font-size: 18px;
    font-weight: 600;
}

.tjm-form-field {
    margin-bottom: 20px;
}

.tjm-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tjm-form-field input[type="number"],
.tjm-form-field input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tjm-form-field input[type="number"]:focus,
.tjm-form-field input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.tjm-form-field .field-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* TJM Calculator */
.tjm-calculator {
    background: #f0f6fb;
    border-left: 4px solid #2271b1;
    padding: 20px;
    margin: 20px 0;
}

.tjm-calculator-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tjm-calculator-total {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #2271b1;
}

/* Responsive */
@media (max-width: 768px) {
    .tjm-project-meta {
        padding: 15px;
    }
    
    .tjm-meta-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tjm-meta-item .value {
        margin-top: 5px;
    }
    
    .tjm-form-section {
        padding: 15px;
    }
}
