/* ==========================================================================
   Friendship NGO - Collaborate Page Styles
   Follows official Friendship brand guidelines & style.css conventions
   ========================================================================== */

:root {
    --fship-primary: #2E3192;
    --fship-primary-hover: #242777;
    --fship-sky: #0d7fbf;
    --fship-dark: #111111;
    --fship-body: #1a1a1a;
    --fship-muted: #555555;
    --fship-border: #d1d5db;
    --fship-bg-light: #f8f9fa;
    --fship-red: #E2392E;
    --fship-blue: #3A8EE7;
    --fship-teal: #149C8F;
    --fship-orange: #F0821E;
}

/* Page wrapper */
.collaborate-page {
    width: 100%;
    background: #ffffff;
    color: var(--fship-body);
}

/* --------------------------------------------------------------------------
   Commitments Section Enhancements
   -------------------------------------------------------------------------- */
.collab-hero-btn-wrap {
    margin-top: 26px;
}

.commitments-copy .btn-more {
    background: linear-gradient(90deg, #2E3192 0%, #313b9f 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 28px !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(46, 49, 146, 0.25);
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
}

.commitments-copy .btn-more:hover {
    background: linear-gradient(90deg, #242777 0%, #29308a 100%) !important;
    box-shadow: 0 6px 20px rgba(46, 49, 146, 0.38);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.commitments-copy .btn-more:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 49, 146, 0.25);
}

/* --------------------------------------------------------------------------
   Section Headers (Shared)
   -------------------------------------------------------------------------- */
.collab-section-header {
    text-align: center;
    margin-bottom: 36px;
}

.collab-section-title {
    font-size: clamp(22px, 3.2vw, 34px);
    font-weight: 700;
    color: var(--fship-dark);
    margin: 0;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.collab-section-underline {
    display: block;
    width: 80px;
    height: 3px;
    background: var(--fship-primary);
    border-radius: 2px;
    margin: 12px auto 18px;
}

.collab-section-sub {
    font-size: 16px;
    line-height: 1.6;
    color: var(--fship-muted);
    max-width: 760px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   3. Collaboration Opportunities Section
   -------------------------------------------------------------------------- */
.collab-opportunities-section {
    background: var(--fship-bg-light);
    padding: clamp(50px, 7vw, 80px) 0;
    border-top: 1px solid #edf0f2;
    border-bottom: 1px solid #edf0f2;
}

.collab-opps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.collab-opp-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 28px 20px;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display: flex;
    flex-direction: column;
}

.collab-opp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: var(--fship-primary);
}

.collab-opp-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--fship-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 18px;
    transition: background .2s ease, color .2s ease;
}

.collab-opp-card:hover .collab-opp-icon {
    background: var(--fship-primary);
    color: #ffffff;
}

.collab-opp-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--fship-dark);
    margin: 0 0 10px;
    line-height: 1.35;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collab-opp-card p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--fship-muted);
    margin: 0;
    flex-grow: 1;
}

/* --------------------------------------------------------------------------
   4. Scrollable Partner Logos (Dynamic from Admin Panel)
   -------------------------------------------------------------------------- */
.collab-marquee-section {
    background: #ffffff;
    padding: clamp(45px, 6vw, 75px) 0;
    border-bottom: 1px solid #edf0f2;
    overflow: hidden;
}

.collab-marquee-header {
    text-align: center;
    margin-bottom: 30px;
}

.collab-marquee-title {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
    color: var(--fship-dark);
    margin: 0;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.collab-marquee-underline {
    display: block;
    width: 60px;
    height: 3px;
    background: var(--fship-primary);
    border-radius: 2px;
    margin: 10px auto 0;
}

.collab-marquee-viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0 16px;
    cursor: grab;
}

.collab-marquee-viewport:active {
    cursor: grabbing;
}

.collab-marquee-track {
    display: flex;
    align-items: center;
    gap: 24px;
    width: max-content;
    animation: collabMarqueeLoop 50s linear infinite;
    padding: 0 10px;
}

.collab-marquee-viewport:hover .collab-marquee-track,
.collab-marquee-viewport:focus-within .collab-marquee-track {
    animation-play-state: paused;
}

@keyframes collabMarqueeLoop {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.collab-marquee-item {
    flex: 0 0 165px;
    width: 165px;
    height: 85px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    text-decoration: none;
}

.collab-marquee-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border-color: var(--fship-primary);
}

.collab-marquee-item img {
    max-width: 100%;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: contrast(1.02);
    display: block;
}

/* --------------------------------------------------------------------------
   5. Collaboration Enquiry Form Section
   -------------------------------------------------------------------------- */
.collab-form-section {
    background: #ffffff;
    padding: clamp(50px, 7vw, 85px) 0;
}

.contact-form__wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    width: 100%;
}

.contact-grid--full {
    grid-column: 1 / -1;
}

.contact-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.collab-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--fship-dark);
    margin-bottom: 6px;
}

.required-star {
    color: var(--fship-red);
    margin-left: 2px;
}

.optional-text {
    font-weight: 400;
    font-size: 13px;
    color: #6b7280;
}

.contact-input,
.contact-textarea {
    width: 100%;
    border: 1px solid var(--fship-border);
    border-radius: 4px;
    background: #ffffff;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.contact-input {
    height: 48px;
}

select.contact-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E3192' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 16px;
    padding-right: 44px;
    cursor: pointer;
}

.contact-textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-input:focus,
.contact-textarea:focus {
    border-color: var(--fship-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 49, 146, 0.12);
}

.contact-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.contact-input.is-invalid,
.contact-textarea.is-invalid {
    border-color: var(--fship-red);
    background-color: #fffbfa;
}

.field-error {
    color: var(--fship-red);
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* Dropzone */
.collab-dropzone {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
    background: #fafafa;
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
    outline: none;
}

.collab-dropzone:hover,
.collab-dropzone:focus,
.collab-dropzone.is-dragover {
    border-color: var(--fship-primary);
    background-color: #f0f4ff;
}

.dropzone-icon {
    font-size: 32px;
    color: var(--fship-primary);
    margin-bottom: 10px;
}

.dropzone-main-text {
    font-size: 14px;
    color: var(--fship-dark);
    margin: 0 0 4px;
}

.dropzone-highlight {
    color: var(--fship-primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dropzone-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.dropzone-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px;
}

.dropzone-file-icon {
    font-size: 26px;
    color: #10b981;
}

.dropzone-file-meta {
    text-align: left;
    max-width: calc(100% - 90px);
    overflow: hidden;
}

.dropzone-file-meta .file-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--fship-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropzone-file-meta .file-size {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.btn-remove-file {
    background: #fee2e2;
    color: var(--fship-red);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
    transition: background .2s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-remove-file:hover {
    background: #fca5a5;
}

.btn-remove-file:active {
    transform: scale(0.92);
}

/* Alerts */
.collab-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.collab-alert i {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.collab-alert-success {
    background: #edf9ee;
    border: 1px solid #a7e3af;
    color: #1d6d2a;
}

.collab-alert-error {
    background: #f7dcdc;
    border: 1px solid #f5c2c7;
    color: #b81623;
}

.d-none {
    display: none !important;
}

/* Submit button */
.contact-btn {
    background: #2E3192 !important;
    background: linear-gradient(90deg, #2E3192 0%, #313b9f 100%) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none;
    height: 52px;
    padding: 0 36px;
    min-width: 290px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(46, 49, 146, 0.28);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-btn:hover:not(:disabled) {
    background: linear-gradient(90deg, #242777 0%, #29308a 100%) !important;
    box-shadow: 0 8px 22px rgba(46, 49, 146, 0.4);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.contact-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 49, 146, 0.3);
}

.contact-btn:focus-visible {
    outline: 2px solid #2E3192;
    outline-offset: 3px;
}

.contact-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner inside button */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .collab-opps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    /* Spacing between sections */
    .collab-opportunities-section {
        padding: 44px 0;
    }

    .collab-marquee-section {
        padding: 38px 0;
    }

    .collab-form-section {
        padding: 44px 0;
    }

    .collab-section-header {
        margin-bottom: 24px;
    }

    .collab-section-title {
        font-size: 22px;
    }

    .collab-section-sub {
        font-size: 14.5px;
    }

    /* Commitments */
    .commitments-wrap {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .commitments-grid {
        gap: 32px 24px;
    }

    .commitments-copy .btn-more {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 14px 20px !important;
        border-radius: 8px;
        font-size: 13.5px;
        -webkit-tap-highlight-color: transparent;
    }

    .commitments-copy .btn-more:active {
        transform: scale(0.98);
    }

    /* Opportunities Cards */
    .collab-opps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .collab-opp-card {
        padding: 22px 18px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .collab-opp-card h3 {
        min-height: auto;
        margin-bottom: 8px;
        font-size: 16px;
    }

    .collab-opp-card p {
        font-size: 14px;
        line-height: 1.5;
    }

    .collab-opp-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-bottom: 12px;
    }

    /* Marquee on mobile: clean touch scroll without scrollbar */
    .collab-marquee-viewport {
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 6px 0 10px;
    }

    .collab-marquee-viewport::-webkit-scrollbar {
        display: none;
    }

    .collab-marquee-item {
        flex: 0 0 135px;
        width: 135px;
        height: 72px;
        border-radius: 8px;
    }

    /* Form on mobile */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Prevents unwanted iOS Safari auto-zoom on field focus */
    .contact-input,
    .contact-textarea,
    select.contact-input {
        font-size: 16px;
        border-radius: 8px;
    }

    .contact-input {
        height: 50px;
        padding: 12px 14px;
    }

    .contact-textarea {
        min-height: 120px;
        padding: 12px 14px;
    }

    /* Dropzone on touch devices */
    .collab-dropzone {
        padding: 22px 16px;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .dropzone-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .dropzone-main-text {
        font-size: 13.5px;
        line-height: 1.4;
    }

    .dropzone-hint {
        font-size: 11.5px;
    }

    /* Actions and Submit Button */
    .contact-actions {
        justify-content: stretch;
        width: 100%;
        margin-top: 10px;
    }

    .contact-btn {
        width: 100%;
        min-width: 0;
        height: 50px;
        font-size: 14.5px;
        letter-spacing: 0.5px;
        padding: 0 20px;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .contact-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    /* Alerts */
    .collab-alert {
        border-radius: 8px;
        padding: 12px 14px;
        font-size: 13.5px;
        margin-bottom: 18px;
    }
}

/* Compact Mobile Devices (<= 480px) */
@media (max-width: 480px) {
    .contact-form__wrap {
        padding: 0 18px;
    }

    .collab-section-title {
        font-size: 21px;
    }
}

/* Small Mobile Devices (<= 375px like iPhone SE) */
@media (max-width: 375px) {
    .contact-form__wrap {
        padding: 0 16px;
    }

    .contact-btn {
        font-size: 13.5px;
        letter-spacing: 0.3px;
        gap: 8px;
        padding: 0 14px;
        height: 48px;
    }

    .commitments-copy .btn-more {
        font-size: 12.5px;
        padding: 12px 14px !important;
        gap: 6px;
    }

    .collab-section-title {
        font-size: 19px;
    }

    .collab-section-sub {
        font-size: 13.5px;
    }

    .collab-opp-card {
        padding: 18px 14px;
    }

    .collab-marquee-item {
        flex: 0 0 125px;
        width: 125px;
        height: 68px;
    }
}

/* Extra Small Mobile Devices (<= 330px like iPhone 5 / Galaxy Fold front) */
@media (max-width: 330px) {
    .contact-form__wrap {
        padding: 0 12px;
    }

    .contact-btn {
        font-size: 12px;
        letter-spacing: 0.2px;
        gap: 6px;
        padding: 0 10px;
        height: 46px;
    }

    .commitments-copy .btn-more {
        font-size: 11.5px;
        padding: 11px 10px !important;
    }

    .collab-marquee-item {
        flex: 0 0 115px;
        width: 115px;
        height: 62px;
    }
}
