/* ==========================================================================
   METTASOUL CONTACT PAGE STYLESHEET
   --------------------------------------------------------------------------
   Font: Arial
   Brand Colors: Teal (Xanh ngọc) & Orange (Cam)
   Spacing: Synchronized with Theme Design Tokens
   ========================================================================== */

#page, #page * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Volunteer activity choices: each item has a fixed checkbox column and a
 * text column so ticks and labels line up consistently in both contact and
 * recruitment forms. */
.volunteer-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin-top: 8px;
}

.volunteer-checkboxes label {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    align-content: start;
    justify-content: start !important;
    column-gap: 10px !important;
    width: 100%;
    margin: 0 !important;
}

.volunteer-checkboxes input {
    width: 16px !important;
    min-width: 16px;
    height: 16px;
    margin: 3px 0 0 !important;
    justify-self: start;
}

@media (min-width: 1025px) {
    .volunteer-checkboxes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .volunteer-checkboxes {
        grid-template-columns: 1fr;
    }
}

/* 01. Section container & spacing overrides */
.contact-info-section {
    padding: 20px 0 !important;
    background-color: var(--ms-bg) !important;
}

.contact-hub-section {
    padding: 30px 0 45px !important;
    position: relative;
    overflow: hidden;
}

/* 02. Two-Column Contact Info & Map Grid */
.contact-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: stretch;
}

/* The desktop heading belongs to the full section, not only the cards column. */
.contact-info-section__title .contact-info-title-break {
    display: none;
}

.contact-info-block-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-block-card {
    background: var(--ms-bg, #ffffff);
    border: 1px solid var(--ms-border-light, #DCE8E6);
    border-radius: var(--ms-radius-md, 12px);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--ms-shadow-soft);
    transition: var(--ms-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.info-block-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ms-shadow-medium);
    border-color: var(--ms-primary-medium, #0D8F97);
}

.info-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(11, 111, 120, 0.06);
    color: var(--ms-primary, #0B6F78);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.info-card-icon svg {
    width: 20px;
    height: 20px;
}

.info-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ms-primary-dark, #0A5C73);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--ms-accent, #F28C00); /* Accent Orange color for primary contact details */
    line-height: 1.4;
    margin-bottom: 8px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card-value a {
    color: var(--ms-accent, #F28C00) !important;
    text-decoration: none;
    transition: var(--ms-transition);
}

.info-card-value a:hover {
    color: var(--ms-primary-dark, #0A5C73) !important;
}

.info-card-desc {
    font-size: 13px;
    color: var(--ms-text-muted, #555);
    margin: 0;
    line-height: 1.4;
}

/* Social links container */
.contact-info-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed var(--ms-border-light, #DCE8E6);
    grid-column: span 2;
}

.socials-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ms-primary-dark, #0A5C73);
}

.info-social-links {
    display: flex;
    gap: 12px;
}

.social-link-item {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: filter 0.2s ease, transform 0.2s ease;
    text-decoration: none !important;
}

.social-link-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.social-link-item:hover {
    filter: drop-shadow(0 6px 10px rgba(5, 94, 101, 0.25));
}

.social-link-item:hover img {
    transform: translateY(-2px) scale(1.08);
}

/* 03. Connection Hub Structure (Desktop/Tablet) */
.contact-hub-container {
    display: grid;
    gap: 24px;
}

/* Contact Cards */
.contact-card {
    background: var(--ms-bg, #ffffff);
    border: 1px solid var(--ms-border-light, #DCE8E6);
    border-radius: var(--ms-radius-md, 12px);
    padding: 24px;
    cursor: pointer;
    transition: var(--ms-transition);
    box-shadow: var(--ms-shadow-soft);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ms-shadow-medium);
    border-color: rgba(11, 111, 120, 0.25);
}

.contact-card:hover::before {
    background-color: rgba(11, 111, 120, 0.4);
}

.contact-card.active {
    border-color: var(--ms-primary, #0B6F78);
    box-shadow: var(--ms-shadow-medium);
    background-color: var(--ms-bg);
}

.contact-card.active::before {
    background-color: var(--ms-primary, #0B6F78);
}

.card-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: rgba(11, 111, 120, 0.05);
    color: var(--ms-primary, #0B6F78);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.contact-card.active .card-icon {
    background-color: var(--ms-primary, #0B6F78);
    color: #ffffff;
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ms-primary-dark, #0A5C73);
    margin: 0;
    line-height: 1.3;
}

.card-desc {
    font-size: 14px;
    color: var(--ms-text-muted, #666);
    line-height: 1.5;
    margin: 0;
}

/* Mobile Toggle Icon (Hidden on Desktop) */
.accordion-toggle-icon {
    display: none;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform 0.3s ease;
}

.accordion-toggle-icon svg {
    width: 20px;
    height: 20px;
}

/* Active style for accordion icon */
.contact-card.active .accordion-toggle-icon {
    transform: rotate(180deg);
    color: var(--ms-primary, #0B6F78);
}

/* Form Wrapper / Wrappers */
.contact-form-wrapper {
    background: var(--ms-bg, #ffffff);
    border: 1px solid var(--ms-border-light, #DCE8E6);
    border-radius: var(--ms-radius-lg, 20px);
    padding: 50px 40px;
    box-shadow: var(--ms-shadow-medium);
    display: none; /* JS will toggle this */
    animation: fadeIn 0.4s ease;
}

.contact-form-wrapper.active {
    display: block;
}

.contact-form-closed {
    padding: 18px 20px;
    border: 1px dashed rgba(11, 111, 120, 0.32);
    border-radius: 12px;
    background: rgba(11, 111, 120, 0.05);
    color: var(--ms-primary-dark, #0A5C73);
    line-height: 1.6;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-title-block {
    border-bottom: 2px solid rgba(11, 111, 120, 0.08);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.form-main-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ms-primary-dark, #0A5C73);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-subtitle {
    font-size: 15px;
    color: var(--ms-text-muted, #666);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

/* Form Input Layout & Fields */
.contact-actual-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 30px;
}

.form-group-full {
    grid-column: span 2;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ms-primary-dark, #0A5C73);
    margin-bottom: 8px;
}

.form-label .required-star {
    color: var(--ms-accent, #F28C00);
    margin-left: 3px;
}

.form-input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--ms-border-light, #DCE8E6);
    border-radius: var(--ms-radius-sm, 8px);
    font-size: 15px;
    color: var(--ms-text, #333);
    background-color: var(--ms-bg, #ffffff);
    box-sizing: border-box;
    transition: var(--ms-transition);
    outline: none;
}

.form-input-field:focus {
    border-color: var(--ms-primary, #0B6F78);
    box-shadow: 0 0 0 3px rgba(11, 111, 120, 0.15);
}

.form-input-field::placeholder {
    color: #94a3b8;
}

textarea.form-input-field {
    resize: vertical;
    min-height: 120px;
}

/* Checkbox group styling */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
    background-color: #fcfcfc;
    padding: 20px 24px;
    border-radius: var(--ms-radius-sm, 8px);
    border: 1px dashed var(--ms-border-light, #DCE8E6);
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14.5px;
    color: #475569;
    line-height: 1.4;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1px solid var(--ms-border-light, #DCE8E6);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--ms-primary, #0B6F78);
    margin-top: 2px;
}

/* Radio button styles */
.radio-group {
    display: flex;
    gap: 24px;
    background-color: #fcfcfc;
    padding: 14px 20px;
    border-radius: var(--ms-radius-sm, 8px);
    border: 1px solid var(--ms-border-light, #DCE8E6);
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14.5px;
    color: #475569;
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ms-primary, #0B6F78);
    cursor: pointer;
}

/* Button & Action styling */
.form-submit-row {
    grid-column: span 2;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--ms-radius-pill, 50px);
    border: none;
    cursor: pointer;
    transition: var(--ms-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--ms-shadow-accent);
}

.btn-pill-orange {
    background-color: var(--ms-accent, #F28C00);
    color: #ffffff;
}

.btn-pill-orange:hover {
    background-color: var(--ms-primary-dark, #0A5C73);
    box-shadow: 0 6px 20px rgba(10, 92, 115, 0.25);
    transform: translateY(-2px);
}

.btn-pill-orange:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Map wrapper styling */
.contact-map-wrapper {
    border-radius: var(--ms-radius-lg, 20px);
    overflow: hidden;
    box-shadow: var(--ms-shadow-soft);
    border: 1px solid var(--ms-border-light, #DCE8E6);
    height: 100%;
    min-height: 400px;
}

.contact-map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Status message styling */
.form-status-msg {
    margin-top: 20px;
    padding: 14px 20px;
    border-radius: var(--ms-radius-sm, 8px);
    font-size: 15px;
    font-weight: 600;
    display: none;
    box-sizing: border-box;
}

.form-status-msg.success {
    display: block;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.form-status-msg.error {
    display: block;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVENESS)
   ========================================================================== */

/* 1. Large desktop/medium desktop (Cards Grid: 5 columns) */
@media (min-width: 992px) {
    .contact-hub-container {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        column-gap: 24px;
        row-gap: 40px; /* spacing between cards and form */
    }
    
    .contact-card[data-target="school"] { grid-column: 1; grid-row: 1; }
    .contact-card[data-target="recruitment"] { grid-column: 2; grid-row: 1; }
    .contact-card[data-target="internship"] { grid-column: 3; grid-row: 1; }
    .contact-card[data-target="volunteer"] { grid-column: 4; grid-row: 1; }
    .contact-card[data-target="consultation"] { grid-column: 5; grid-row: 1; }
    
    .contact-form-wrapper {
        grid-row: 2;
        grid-column: 1 / 6;
    }
}

/* 2. Tablet Mode (Cards Grid: 2 columns, Columns Stacked for Info & Map) */
@media (max-width: 991px) {
    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-info-map-col {
        height: 380px;
    }
    
    .contact-info-socials {
        grid-column: span 1;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .contact-hub-container {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 20px;
        row-gap: 30px;
    }
    
    .contact-card[data-target="school"] { grid-column: 1; grid-row: 1; }
    .contact-card[data-target="recruitment"] { grid-column: 2; grid-row: 1; }
    .contact-card[data-target="internship"] { grid-column: 1; grid-row: 2; }
    .contact-card[data-target="volunteer"] { grid-column: 2; grid-row: 2; }
    .contact-card[data-target="consultation"] { grid-column: 3; grid-row: 2; }
    
    .contact-form-wrapper {
        grid-row: 3;
        grid-column: 1 / 4;
        padding: 40px 30px;
    }
    
    .contact-actual-form {
        gap: 20px 24px;
    }
}

/* Teal overlay for the text side of the contact banner. */
#page .ms-page-banner--contact .ms-page-banner__content {
    background: linear-gradient(
        90deg,
        rgba(11, 111, 120, 0.52) 0%,
        rgba(11, 111, 120, 0.42) 44%,
        rgba(11, 111, 120, 0.12) 63%,
        rgba(11, 111, 120, 0) 76%
    );
}

/* 3. Mobile Mode (Accordion Behavior) */
@media (max-width: 767px) {
    /* Keep the contact banner copy vertically balanced within the image. */
    .ms-page-banner--contact .ms-page-banner__content {
        position: absolute !important;
        inset: 0;
        height: 100% !important;
        min-height: 0 !important;
        padding: 22px 20px !important;
        justify-content: center;
    }

    .contact-info-section {
        padding: 20px 0 !important;
    }

    .contact-info-map-col {
        height: clamp(260px, 72vw, 320px);
        min-height: 0;
    }

    .contact-map-wrapper {
        height: 100%;
        min-height: 0;
    }

    .contact-map-wrapper iframe {
        width: 100% !important;
        height: 100% !important;
    }

    .contact-info-section__title {
        text-align: center !important;
        margin-bottom: 20px !important;
    }

    .contact-info-section__title .title-line {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .contact-info-section__title .contact-info-title-break {
        display: block;
    }

    .contact-hub-section {
        padding: 25px 0 !important;
    }

    .contact-info-block-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .info-block-card {
        padding: 18px 12px !important;
        border-radius: 8px !important;
    }

    .info-card-icon {
        width: 36px !important;
        height: 36px !important;
        margin-bottom: 8px !important;
    }

    .info-card-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .info-card-title {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    .info-card-value {
        font-size: 12.5px !important;
        margin-bottom: 4px !important;
        word-break: break-word;
    }

    .info-card-desc {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    .contact-info-socials {
        grid-column: span 2 !important;
        margin-top: 15px !important;
        padding-top: 12px !important;
    }

    /* Transform to Flexbox Column so order property works */
    .contact-hub-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    /* Make card look like an accordion header */
    .contact-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-radius: var(--ms-radius-sm, 8px);
        border: 1px solid var(--ms-border-light, #DCE8E6);
        box-shadow: var(--ms-shadow-soft);
    }
    
    .contact-card:hover {
        transform: none; /* No lifting on mobile hover */
        box-shadow: var(--ms-shadow-soft);
    }

    .card-header-info {
        margin-bottom: 0;
        gap: 12px;
        text-align: left;
    }
    
    .card-icon {
        width: 36px;
        height: 36px;
    }
    
    .card-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-desc {
        display: none; /* Hide card description in accordion header to save space */
    }
    
    /* Show Toggle Chevron on Mobile */
    .accordion-toggle-icon {
        display: flex;
    }
    
    /* Form Accordion Panels */
    .contact-form-wrapper {
        border-radius: var(--ms-radius-sm, 8px);
        padding: 24px 20px;
        box-shadow: none;
        margin-top: -4px; /* merge slightly with the header */
        margin-bottom: 10px;
        border-top: none; /* remove top border since it attaches to active card above */
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        
        /* Height animation preparation */
        max-height: 0;
        overflow: hidden;
        display: block; /* always block but controlled by height & opacity */
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.3s ease, 
                    padding 0.4s ease, 
                    border-width 0.4s ease;
    }
    
    .contact-form-wrapper.active {
        opacity: 1;
        padding-top: 24px;
        padding-bottom: 24px;
        border-width: 1px;
    }

    .form-title-block {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .form-main-title {
        font-size: 18px;
    }
    
    .form-subtitle {
        font-size: 13.5px;
    }
    
    .contact-actual-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-group-full {
        grid-column: span 1;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 10px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .form-submit-row {
        grid-column: span 1;
        margin-top: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .btn-pill {
        width: 100%;
        padding: 12px 24px;
        font-size: 15px;
    }
}
