/* ==========================================
   STATIC SECTION HEADING (e.g. "Complete your profile")
   ========================================== */
.pfb-static-section-heading {
    margin-top: 32px !important;
    margin-bottom: 0 !important;
    padding: 0 20px !important;
}

.pfb-static-heading-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    text-align: left !important;
}

.pfb-static-section-body {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================
   ACCORDION SECTIONS — Minimal Clean Design
   ========================================== */

.pfb-accordion-section {
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
    margin-top: 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

/* First accordion section gets more top spacing */
.pfb-accordion-section:first-of-type {
    margin-top: 16px !important;
}

/* Legend — CRITICAL: force it to sit inside fieldset, not float on border */
.pfb-accordion-legend {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    /* Fix browser legend floating behaviour */
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

/* The clickable header div — white bg, black text, NO theme overrides */
.pfb-accordion-header {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid transparent !important;
    cursor: pointer !important;
    text-align: left !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    line-height: 1.4 !important;
    transition: background 0.15s ease !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    /* Div-specific resets */
    user-select: none !important;
    -webkit-user-select: none !important;
    box-sizing: border-box !important;
}

.pfb-accordion-header:hover {
    background: #f9fafb !important;
    background-color: #f9fafb !important;
    color: #111827 !important;
}

.pfb-accordion-header:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Open state — subtle bottom border only */
.pfb-accordion-section.pfb-is-open .pfb-accordion-header {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Section title text */
.pfb-accordion-title {
    flex: 1 !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

/* Chevron icon — SVG chevron-down, rotates on open */
.pfb-accordion-icon {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    background: none !important;
    border: none !important;
    display: block !important;
    position: relative !important;
    opacity: 1 !important;
    transition: transform 0.25s ease !important;
    /* Chevron down using CSS border trick */
    margin-left: 12px !important;
}

/* Draw chevron using ::before pseudo-element */
.pfb-accordion-icon::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 10px !important;
    height: 10px !important;
    border-right: 2px solid #6b7280 !important;
    border-bottom: 2px solid #6b7280 !important;
    transform: translate(-50%, -65%) rotate(45deg) !important;
    transition: transform 0.25s ease !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.pfb-accordion-icon::after {
    display: none !important;
}

/* Rotate chevron when open */
.pfb-accordion-section.pfb-is-open .pfb-accordion-icon::before {
    transform: translate(-50%, -35%) rotate(225deg) !important;
}

/* Collapsible body */
.pfb-accordion-body {
    padding: 20px !important;
    background: #ffffff !important;
    overflow: hidden !important;
}

/* Hidden state — beats inline display:grid from renderer.php */
.pfb-accordion-body[hidden] {
    display: none !important;
}

/* Remove any nested section-wrapper styles inside accordion */
.pfb-accordion-section .pfb-section-wrapper {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ==========================================
   END ACCORDION SECTIONS
   ========================================== */


.pfb-form {
    max-width: 100%;
    padding: 25px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    border-radius: 8px;
}

/* Section Grouping Style (V2) — only for non-accordion sections */
.pfb-section-wrapper:not(.pfb-accordion-section) {
    margin-bottom: 35px !important;
    border: none !important;
    padding: 25px !important;
    border-radius: 10px !important;
    background: #fdfdfd;
}

/* Reset pfb-section-wrapper padding/margin when it IS an accordion section */
.pfb-accordion-section.pfb-section-wrapper {
    padding: 0 !important;
    margin-bottom: 10px !important;
    background: #ffffff !important;
}

.pfb-section-wrapper legend {
    display: block !important;
    visibility: visible !important;
    padding: 0px !important;
    font-weight: 700 !important;
    font-size: 1.25em !important;
    color: #2271b1;
    background: #fff;
    border-radius: 4px;
}

.pfb-field {
    margin-bottom: 20px;
}

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

.pfb-field input,
.pfb-field select,
.pfb-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

/* Error States */
.pfb-has-error label { color: #e53935; }
.pfb-error-input { border: 1.5px solid #e53935 !important; background: #fff6f6; }

/* ==========================================
   USER PROFILE VIEW STYLING
   ========================================== */
.pfb-profile-container {
    max-width: 850px;
    margin: 30px auto;
}

.pfb-profile-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    border: 1px solid #f0f0f0;
}

.pfb-profile-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile-e single column */
    gap: 15px;
}
.pfb-info-item {
    /* background: #f8f9fa; */
    /* padding: 18px; */
    border-radius: 8px;
    /* border-left: 5px solid #ffae00; */
}

.pfb-info-item.full-width { grid-column: span 1; } /* Desktop e span fixed hobe query te */

@media (min-width: 768px) {
    .pfb-info-item.full-width { grid-column: span 2; }
    .pfb-profile-grid {
        grid-template-columns: repeat(2, 1fr); /* Desktop-e double column */
    }
}

.pfb-label {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 6px;
}

.pfb-value { font-size: 16px; color: #2c3e50; }
.pfb-view-value { word-wrap: break-word; }

.pfb-btn-edit {
    display: block;
    width: fit-content;
    margin: 30px auto 0;
    background: #111827;
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.pfb-btn-edit:hover { background: #34495e; color: #fff; }

/* ==========================================
   BUTTONS STYLING (FRONTEND)
   ========================================== */

/* Main Submit & Update Button */
.pfb-submit-btn {
    background-color: #2271b1; /* WordPress Primary Blue */
    color: #ffffff;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.pfb-submit-btn:hover {
    background-color: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Cancel / Back Button */
.pfb-btn-cancel {
    background-color: #f6f7f7;
    color: #3c434a;
    padding: 11px 25px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.pfb-btn-cancel:hover {
    background-color: #f0f0f1;
    border-color: #c3c4c7;
    color: #1d2327;
}

/* Download Button (Profile & Admin View) */
.pfb-btn-download {
    background-color: #2c3e50;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
    margin-top: 5px;
}

.pfb-btn-download:hover {
    background-color: #1a252f;
}

/* Edit Profile Button */
.pfb-btn-edit {
    background-color: #111827;
    color: #ffffff !important;
    padding: 12px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background 0.3s;
}

.pfb-btn-edit:hover {
    background-color: #374151;
}

/* Form Footer Container */
.pfb-form-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Radio Button UI Optimization */
.pfb-field input[type="radio"] {
    width: auto !important;
    margin-right: 10px !important;
    cursor: pointer;
    accent-color: #2271b1; /* WordPress primary blue for consistent branding */
}

.pfb-field label.pfb-radio-label {
    display: flex;
    align-items: center;
    /* background: #f9f9f9; */
    padding: 3px 15px;
    /* border: 1px solid #ddd; */
    border-radius: 6px;
    margin-bottom: 8px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pfb-field label.pfb-radio-label:hover {
    /* background: #f0f7ff; */
    /* border-color: #2271b1; */
}

/* Style for selected state via CSS selector */
.pfb-field input[type="radio"]:checked + span {
    color: #2271b1;
    font-weight: 600;
}

/**
 * Layout Grid System
 * Synchronized with dynamic settings from renderer.php
 */
/* .pfb-section-wrapper {
    display: grid;
    grid-template-columns: 1fr; 
    width: 100%;
    border: none !important;
}
.pfb-section-wrapper legend{
    padding: 0px !important;
} */

/**
 * Responsive Desktop Layout
 * Grid columns are dynamically overridden via inline styles in renderer.php
 */
@media (min-width: 768px) {
    .pfb-section-wrapper {
        /* Desktop specific layout rules */
    }
}