/* ===== IF Contact Card — Public Styles ===== */

.ifcc-wrapper {
    --plum:     var(--ifcc-plum,      #71335a);
    --mauve:    var(--ifcc-mauve,     #9b7a99);
    --rose:     var(--ifcc-rose,      #ce9c9c);
    --cream:    var(--ifcc-cream,     #e5ddd2);
    --sage:     var(--ifcc-sage,      #a9b6a7);
    --dsage:    var(--ifcc-dsage,     #596757);
    --char:     var(--ifcc-charcoal,  #4d4646);

    position: relative;
    width: 100%;
    max-width: 480px;
    min-height: 100svh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background 0.35s ease, color 0.35s ease;
}

/* ---- DARK THEME (default) ---- */
.ifcc-dark {
    background: #111;
    color: var(--cream);
}
.ifcc-dark .ifcc-toggle-bar { background: #111; border-bottom: 1px solid #2c2418; }
.ifcc-dark .ifcc-theme-toggle { background: #2c2418; border: 1px solid #4d4646; color: var(--mauve); }
.ifcc-dark .ifcc-moon { display: flex; }
.ifcc-dark .ifcc-sun  { display: none; }
.ifcc-dark .ifcc-banner { background: linear-gradient(135deg, var(--plum) 0%, var(--mauve) 60%, var(--rose) 100%); }
.ifcc-dark .ifcc-banner-label { color: rgba(255,255,255,0.35); }
.ifcc-dark .ifcc-avatar { background: var(--cream); border-color: #111; color: var(--plum); }
.ifcc-dark .ifcc-name  { color: var(--cream); }
.ifcc-dark .ifcc-title { color: var(--mauve); }
.ifcc-dark .ifcc-bio   { color: var(--sage); }
.ifcc-dark .ifcc-social-btn { background: #2c2418; border-color: #4d4646; color: var(--mauve); }
.ifcc-dark .ifcc-social-btn:hover { background: #3d3020; border-color: var(--mauve); }
.ifcc-dark .ifcc-divider { background: #2c2418; }
.ifcc-dark .ifcc-link { background: #2c2418; border-color: #3d3020; }
.ifcc-dark .ifcc-link:hover { background: #3d3020; border-color: var(--char); }
.ifcc-dark .ifcc-link-icon { background: rgba(155,122,153,0.15); color: var(--mauve); }
.ifcc-dark .ifcc-link-sub { color: var(--dsage); }
.ifcc-dark .ifcc-link-lbl { color: var(--cream); }
.ifcc-dark .ifcc-link-arrow { color: var(--dsage); }
.ifcc-dark .ifcc-link-featured { background: var(--plum) !important; border-color: var(--mauve) !important; }
.ifcc-dark .ifcc-link-featured .ifcc-link-icon { background: rgba(229,221,210,0.15); color: var(--cream); }
.ifcc-dark .ifcc-link-featured .ifcc-link-sub { color: var(--rose); }
.ifcc-dark .ifcc-link-featured .ifcc-link-arrow { color: var(--rose); }
.ifcc-dark .ifcc-sticky-actions { background: #111; border-top: 1px solid #2c2418; }
.ifcc-dark .ifcc-btn-save { background: #1e1a14; border-color: var(--dsage); color: var(--sage); }
.ifcc-dark .ifcc-btn-save:hover { background: #2c2418; }
.ifcc-dark .ifcc-btn-exchange { background: var(--dsage); border-color: var(--dsage); color: var(--cream); }
.ifcc-dark .ifcc-btn-exchange:hover { background: var(--sage); }
.ifcc-dark .ifcc-modal-overlay { background: rgba(0,0,0,0.75); }
.ifcc-dark .ifcc-modal { background: #1a1412; border: 1px solid #3d3020; }
.ifcc-dark .ifcc-modal-heading { color: var(--cream); }
.ifcc-dark .ifcc-modal-sub { color: var(--sage); }
.ifcc-dark .ifcc-form-label { color: var(--mauve); }
.ifcc-dark .ifcc-form-input { background: #2c2418; border-color: #4d4646; color: var(--cream); }
.ifcc-dark .ifcc-form-input:focus { border-color: var(--mauve); }
.ifcc-dark .ifcc-form-submit { background: var(--plum); color: var(--cream); border-color: var(--mauve); }
.ifcc-dark .ifcc-form-submit:hover { background: var(--mauve); }
.ifcc-dark .ifcc-modal-close { background: #2c2418; border-color: #4d4646; color: var(--mauve); }

/* ---- LIGHT THEME ---- */
.ifcc-light {
    background: #faf7f2;
    color: #2c1f0e;
}
.ifcc-light .ifcc-toggle-bar { background: #faf7f2; border-bottom: 1px solid var(--cream); }
.ifcc-light .ifcc-theme-toggle { background: var(--cream); border: 1px solid #d4c8bc; color: var(--plum); }
.ifcc-light .ifcc-moon { display: none; }
.ifcc-light .ifcc-sun  { display: flex; }
.ifcc-light .ifcc-banner { background: linear-gradient(135deg, var(--cream) 0%, var(--rose) 50%, var(--mauve) 100%); }
.ifcc-light .ifcc-banner-label { color: rgba(113,51,90,0.4); }
.ifcc-light .ifcc-avatar { background: var(--plum); border-color: #faf7f2; color: var(--cream); }
.ifcc-light .ifcc-name  { color: #2c1f0e; }
.ifcc-light .ifcc-title { color: var(--mauve); }
.ifcc-light .ifcc-bio   { color: var(--dsage); }
.ifcc-light .ifcc-social-btn { background: var(--cream); border-color: #d4c8bc; color: var(--plum); }
.ifcc-light .ifcc-social-btn:hover { background: #ede4d8; border-color: var(--rose); }
.ifcc-light .ifcc-divider { background: var(--cream); }
.ifcc-light .ifcc-link { background: #fff; border-color: var(--cream); }
.ifcc-light .ifcc-link:hover { background: #f5f0e8; border-color: var(--rose); }
.ifcc-light .ifcc-link-icon { background: #f4ede8; color: var(--plum); }
.ifcc-light .ifcc-link-sub { color: var(--sage); }
.ifcc-light .ifcc-link-lbl { color: #2c1f0e; }
.ifcc-light .ifcc-link-arrow { color: var(--rose); }
.ifcc-light .ifcc-link-featured { background: var(--plum) !important; border-color: var(--mauve) !important; }
.ifcc-light .ifcc-link-featured .ifcc-link-icon { background: rgba(229,221,210,0.2); color: var(--cream); }
.ifcc-light .ifcc-link-featured .ifcc-link-lbl { color: var(--cream); }
.ifcc-light .ifcc-link-featured .ifcc-link-sub { color: var(--rose); }
.ifcc-light .ifcc-link-featured .ifcc-link-arrow { color: var(--rose); }
.ifcc-light .ifcc-sticky-actions { background: #faf7f2; border-top: 1px solid var(--cream); }
.ifcc-light .ifcc-btn-save { background: #fff; border-color: var(--sage); color: var(--dsage); }
.ifcc-light .ifcc-btn-save:hover { background: var(--cream); }
.ifcc-light .ifcc-btn-exchange { background: var(--plum); border-color: var(--plum); color: var(--cream); }
.ifcc-light .ifcc-btn-exchange:hover { background: var(--mauve); }
.ifcc-light .ifcc-modal-overlay { background: rgba(44,31,14,0.6); }
.ifcc-light .ifcc-modal { background: #faf7f2; border: 1px solid var(--cream); }
.ifcc-light .ifcc-modal-heading { color: #2c1f0e; }
.ifcc-light .ifcc-modal-sub { color: var(--dsage); }
.ifcc-light .ifcc-form-label { color: var(--plum); }
.ifcc-light .ifcc-form-input { background: #fff; border-color: var(--cream); color: #2c1f0e; }
.ifcc-light .ifcc-form-input:focus { border-color: var(--plum); }
.ifcc-light .ifcc-form-submit { background: var(--plum); color: var(--cream); border-color: var(--plum); }
.ifcc-light .ifcc-form-submit:hover { background: var(--mauve); }
.ifcc-light .ifcc-modal-close { background: var(--cream); border-color: #d4c8bc; color: var(--plum); }

/* ---- SHARED STRUCTURAL STYLES ---- */
.ifcc-toggle-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    padding: 8px 14px;
}
.ifcc-theme-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ifcc-theme-toggle:hover { transform: scale(1.1); }
.ifcc-toggle-icon { display: flex; align-items: center; justify-content: center; }
.ifcc-toggle-icon svg { width: 16px; height: 16px; }

.ifcc-banner {
    width: 100%;
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.ifcc-banner-label {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.ifcc-avatar-wrap {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
}
.ifcc-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 3px solid;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 600;
    overflow: hidden;
    object-fit: cover;
    transition: all 0.35s ease;
}
img.ifcc-avatar { object-fit: cover; }

.ifcc-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 48px 18px 18px;
    -webkit-overflow-scrolling: touch;
}
.ifcc-scroll-area::-webkit-scrollbar { width: 3px; }
.ifcc-scroll-area::-webkit-scrollbar-track { background: transparent; }
.ifcc-scroll-area::-webkit-scrollbar-thumb { background: rgba(155,122,153,0.3); border-radius: 3px; }

.ifcc-profile { text-align: center; margin-bottom: 18px; }
.ifcc-name  { font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; }
.ifcc-title { font-size: 0.8rem; letter-spacing: 0.06em; margin: 0 0 8px; }
.ifcc-bio   { font-size: 0.82rem; line-height: 1.6; margin: 0; }

.ifcc-socials {
    display: flex; justify-content: center;
    flex-wrap: wrap; gap: 8px;
    margin-bottom: 18px;
}
.ifcc-social-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}
.ifcc-social-btn svg { width: 16px; height: 16px; }
.ifcc-social-btn:hover { transform: translateY(-2px); }

.ifcc-divider { height: 1px; margin: 0 0 14px; }

.ifcc-links { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.ifcc-link {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid;
    border-radius: 12px;
    padding: 12px 14px;
    text-decoration: none;
    transition: all 0.2s;
}
.ifcc-link:hover { transform: translateX(3px); }
.ifcc-link-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ifcc-link-icon svg { width: 16px; height: 16px; }
.ifcc-link-txt { flex: 1; }
.ifcc-link-sub { display: block; font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 2px; }
.ifcc-link-lbl { display: block; font-size: 0.9rem; font-weight: 600; }
.ifcc-link-arrow { font-size: 1rem; transition: transform 0.2s; }
.ifcc-link:hover .ifcc-link-arrow { transform: translateX(3px); }

.ifcc-sticky-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 18px 18px;
    flex-shrink: 0;
    z-index: 50;
}
.ifcc-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 13px 10px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ifcc-btn svg { width: 15px; height: 15px; }
.ifcc-btn:hover { transform: translateY(-1px); }
.ifcc-btn:active { transform: translateY(0); }

/* Modal */
.ifcc-modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    align-items: center; justify-content: center;
    padding: 20px;
}
.ifcc-modal-overlay.open { display: flex; }
.ifcc-modal {
    width: 100%; max-width: 420px;
    border-radius: 18px;
    padding: 28px 24px;
    position: relative;
    animation: ifccSlideUp 0.3s ease;
}
@keyframes ifccSlideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
.ifcc-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid; font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ifcc-modal-close:hover { transform: rotate(90deg); }
.ifcc-modal-heading { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }
.ifcc-modal-sub { font-size: 0.82rem; margin: 0 0 20px; line-height: 1.5; }
.ifcc-form { display: flex; flex-direction: column; gap: 6px; }
.ifcc-form-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 2px; }
.ifcc-form-input {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    margin-bottom: 8px;
}
.ifcc-form-textarea { resize: vertical; min-height: 80px; }
.ifcc-form-submit {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s;
}
.ifcc-form-submit:hover { transform: translateY(-1px); }
.ifcc-form-msg { text-align: center; font-size: 0.82rem; margin: 6px 0 0; min-height: 20px; }
.ifcc-form-msg.success { color: #596757; }
.ifcc-form-msg.error   { color: #ce9c9c; }

/* Responsive: if page is wide, show as centered card */
@media (min-width: 520px) {
    .ifcc-wrapper {
        border-radius: 24px;
        overflow: hidden;
        min-height: 680px;
        max-height: 90vh;
        box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    }
}
