/**
 * Minister Contact Card Styles
 * Version: 1.0.0
 * Place this file at: /wp-content/plugins/minister-contact-card/assets/css/minister-card.css
 */

/* ===== Variables ===== */
:root {
    --mcc-primary: #059669;
    --mcc-primary-hover: #047857;
    --mcc-text-dark: #111827;
    --mcc-text-gray: #6b7280;
    --mcc-text-medium: #374151;
    --mcc-border: #e5e7eb;
    --mcc-bg-light: #f3f4f6;
    --mcc-bg-badge: #f3f4f6;
    --mcc-facebook: #1877f2;
    --mcc-instagram-start: #f09433;
    --mcc-instagram-end: #bc1888;
    --mcc-youtube: #ff0000;
    --mcc-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --mcc-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Reset & Base Styles ===== */
.mcc-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.mcc-wrapper {
    max-width: 1024px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--mcc-text-dark);
    line-height: 1.6;
}

/* ===== Main Card ===== */
.mcc-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--mcc-shadow);
    padding: 2rem;
    position: relative;
    margin-bottom: 2rem;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    touch-action: pan-y;
    /* Allow vertical scrolling but handle horizontal for swipes */
    cursor: grab;
    /* Indicate card is draggable */
    user-select: none;
    /* Prevent text selection during swipe */
}

.mcc-card:active {
    cursor: grabbing;
}

/* Swipe animation feedback */
.mcc-card.mcc-swipe-left {
    transform: translateX(-30px);
    opacity: 0.7;
}

.mcc-card.mcc-swipe-right {
    transform: translateX(30px);
    opacity: 0.7;
}

/* Swipe indicators */
.mcc-swipe-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: var(--mcc-primary);
    opacity: 0.3;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mcc-swipe-arrow-left {
    left: 10px;
}

.mcc-swipe-arrow-right {
    right: 10px;
}

.mcc-swipeable:hover .mcc-swipe-arrow {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .mcc-swipe-arrow {
        opacity: 0.5;
    }
}

/* ===== Credential Badge ===== */
.mcc-credential {
    background: var(--mcc-bg-badge);
    color: #9ca3af;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    display: inline-block;
    top: 0;
    left: 0;
    z-index: 13;
}

/* Badge row to show credential and section name side-by-side */
.mcc-badge-row {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    z-index: 12;
    /* ensure badges appear above other elements */
}

.mcc-section {
    /* Match credential pill styling */
    background: var(--mcc-bg-badge);
    color: #9ca3af;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    display: inline-block;
    margin-left: 0.25rem;
    z-index: 13;
    color: #6b7280;
    /* slightly darker for better contrast */
    top: 0;
    /* place to the right of the credential pill; adjust if necessary */
    left: 110px;
}

.mcc-credential,
.mcc-section {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive: stack badge row items on small screens */
@media (max-width: 480px) {
    .mcc-badge-row {
        position: absolute;
        top: 1.25rem;
        left: 1rem;
        display: block;
    }

    .mcc-credential,
    .mcc-section {
        position: static;
        display: inline-block;
        margin-right: 0.5rem;
    }
}

/* ===== Profile Photo ===== */
.mcc-photo {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 192px;
    height: 192px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mcc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== Social Icons ===== */
.mcc-social {
    z-index: 1;
}

/* Support for Elementor's social icons structure */
.mcc-social.elementor-social-icons-wrapper {
    display: flex;
    gap: 0.75rem;
}

.mcc-social .elementor-grid-item {
    display: inline-flex;
}

.mcc-social-link,
.mcc-social .elementor-icon {
    width: 40px;
    height: 40px;
    border-radius: 103px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 20px;
}

.mcc-social-link:hover,
.mcc-social .elementor-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--mcc-shadow-hover);
}

.mcc-facebook,
.mcc-social .elementor-social-icon-facebook {
    background: var(--mcc-primary);
}

.mcc-instagram,
.mcc-social .elementor-social-icon-instagram {
    background: var(--mcc-primary);
}

.mcc-youtube,
.mcc-social .elementor-social-icon-youtube {
    background: var(--mcc-primary);
}

/* Ensure Font Awesome icons are centered */
.mcc-social i.fab {
    font-size: 20px;
    line-height: 1;
}

/* ===== Content Area ===== */
.mcc-content {
    padding-top: 4rem;
}

/* ===== Header Section ===== */
.mcc-header {
    margin-bottom: 2rem;
}

.mcc-name {
    font-size: 2rem;
    font-weight: 600;
    color: var(--mcc-text-dark);
    margin-bottom: 0.25rem;
}

.mcc-position {
    color: var(--mcc-text-gray);
    font-size: 1rem;
}

/* ===== Birthday Section ===== */
.mcc-birthday {
    margin-bottom: 2rem;
}

.mcc-date {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mcc-text-dark);
    margin-bottom: 0.25rem;
}

.mcc-label {
    color: var(--mcc-text-gray);
    font-size: 0.875rem;
}

/* ===== Family Info Grid ===== */
.mcc-family {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.mcc-family-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mcc-text-dark);
    margin-bottom: 0.25rem;
}

.mcc-family-item p {
    color: var(--mcc-text-gray);
    font-size: 0.875rem;
}

/* ===== Info Sections ===== */
.mcc-info,
.mcc-church,
.mcc-notes {
    margin-bottom: 2rem;
}

.mcc-church {
    border-top: 1px solid var(--mcc-border);
    padding-top: 2rem;
}

.mcc-notes {
    border-top: 1px solid var(--mcc-border);
    padding-top: 2rem;
}

/* ===== Info Rows ===== */
.mcc-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.mcc-row-label {
    font-weight: 600;
    color: var(--mcc-text-dark);
    min-width: 160px;
    flex-shrink: 0;
}

.mcc-row-value {
    color: var(--mcc-text-medium);
    flex: 1;
    word-break: break-word;
}

.mcc-row-value a {
    color: var(--mcc-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.mcc-row-value a:hover {
    color: var(--mcc-primary-hover);
    text-decoration: underline;
}

/* ===== Footer Actions ===== */
.mcc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--mcc-border);
}

.mcc-actions {
    display: flex;
    gap: 0.5rem;
}

.mcc-btn-contact {
    background: var(--mcc-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
    display: inline-block;
}

.mcc-btn-contact:hover {
    background: var(--mcc-primary-hover);
    color: white;
}

.mcc-btn-call {
    background: var(--mcc-primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    text-decoration: none;
}

.mcc-btn-call:hover {
    background: var(--mcc-primary-hover);
}

.mcc-update {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mcc-text-gray);
    font-size: 0.875rem;
}

.mcc-update strong {
    color: var(--mcc-text-medium);
    font-weight: 500;
}

.mcc-btn-print {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--mcc-text-gray);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mcc-btn-print:hover {
    background: var(--mcc-bg-light);
    color: var(--mcc-text-medium);
}

/* ===== Church Profile Button ===== */
.mcc-church-profile {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.mcc-church-profile {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Use contact button base but reduce padding for the church profile button */
.mcc-church-profile .mcc-btn-contact {
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    display: inline-block;
    border-radius: 9999px;
}

/* Align under the value column (label min-width is 160px) */
.mcc-church-profile {
    margin-left: 160px;
    /* matches .mcc-row-label min-width */
}

/* Debug box for admin users */
/* debug removed */

/* ===== Navigation ===== */
.mcc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Swipe indicators for mobile */
@media (max-width: 768px) {
    .mcc-wrapper {
        position: relative;
    }

    .mcc-wrapper::before,
    .mcc-wrapper::after {
        content: '';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 40px;
        background: linear-gradient(to right, transparent, rgba(5, 150, 105, 0.1), transparent);
        pointer-events: none;
        z-index: 1;
        opacity: 0;
        animation: swipeHint 3s ease-in-out infinite;
    }

    .mcc-wrapper::before {
        left: 0;
        animation-delay: 0s;
    }

    .mcc-wrapper::after {
        right: 0;
        background: linear-gradient(to left, transparent, rgba(5, 150, 105, 0.1), transparent);
        animation-delay: 1.5s;
    }

    /* Hide hints if no navigation available */
    .mcc-wrapper:not(:has(.mcc-nav-prev))::before,
    .mcc-wrapper:not(:has(.mcc-nav-next))::after {
        display: none;
    }
}

@keyframes swipeHint {

    0%,
    70%,
    100% {
        opacity: 0;
    }

    15%,
    55% {
        opacity: 0.6;
    }
}

/* Swipe hint notification */
.mcc-swipe-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.mcc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mcc-text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.mcc-nav-link:hover {
    color: var(--mcc-text-dark);
}

.mcc-nav-info {
    display: flex;
    flex-direction: column;
}

.mcc-nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.mcc-nav-title {
    font-weight: 500;
    color: inherit;
}

.mcc-nav-grid {
    padding: 0.75rem;
    color: var(--mcc-text-gray);
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcc-nav-grid:hover {
    background: var(--mcc-bg-light);
    color: var(--mcc-text-medium);
}

.mcc-all {
    text-align: center;
}

.mcc-all a {
    color: var(--mcc-text-medium);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mcc-all a:hover {
    color: var(--mcc-text-dark);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .mcc-social {
        right: 14rem;
    }
}

@media (max-width: 768px) {
    .mcc-card {
        padding: 1.5rem;
    }

    .mcc-credential {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
    }

    .mcc-photo {
        position: static;
        margin: 0 auto 2rem;
        width: 200px;
        height: 200px;
    }

    .mcc-social {
        position: static;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .mcc-content {
        padding-top: 0;
    }

    .mcc-name {
        font-size: 1.5rem;
        text-align: center;
    }

    .mcc-position {
        text-align: center;
    }

    .mcc-birthday {
        text-align: center;
    }

    .mcc-family {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
        max-width: 100%;
    }

    .mcc-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .mcc-row-label {
        min-width: unset;
        font-size: 0.875rem;
    }

    .mcc-footer {
        flex-direction: column;
        gap: 1.5rem;
    }

    .mcc-update {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .mcc-nav {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .mcc-nav-link {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .mcc-wrapper {
        padding: 1rem 0.5rem;
    }

    .mcc-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .mcc-photo {
        width: 200px;
        height: 200px;
        margin-top: 62px;
    }

    .mcc-name {
        font-size: 1.25rem;
    }

    .mcc-btn-contact {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }

    .mcc-btn-call {
        width: 42px;
        height: 42px;
    }

    .mcc-social-link {
        width: 36px;
        height: 36px;
    }

    .mcc-social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== Print Styles ===== */
@media print {

    .mcc-nav,
    .mcc-all,
    .mcc-btn-print,
    .mcc-social {
        display: none !important;
    }

    .mcc-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .mcc-wrapper {
        max-width: 100%;
        padding: 0;
    }

    .mcc-credential {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
    }

    .mcc-photo {
        position: static;
        margin: 0 auto 2rem;
    }

    .mcc-row-value a {
        color: var(--mcc-text-medium);
        text-decoration: none;
    }
}