/**
 * Marthoma Church Theme - Button Styles
 *
 * @package MarthomaChurch
 */

/* Button CSS Custom Properties */
:root {
    --marthoma-btn-bg: var(--marthoma-button, #375EFB);
    --marthoma-btn-text: #ffffff;
    --marthoma-btn-padding-v: 12px;
    --marthoma-btn-padding-h: 24px;
    --marthoma-btn-radius: 2px;
    --marthoma-btn-transition: 0.3s ease;
}

/* Base Button Styles */
.btn,
button[type="submit"],
input[type="submit"],
input[type="button"],
.elementor-button,
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    font-family: var(--marthoma-font-heading);
    font-weight: var(--marthoma-font-weight-button);
    font-size: 1rem;
    background-color: var(--marthoma-btn-bg);
    color: var(--marthoma-btn-text);
    padding: var(--marthoma-btn-padding-v) var(--marthoma-btn-padding-h);
    border-radius: var(--marthoma-btn-radius);
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: all var(--marthoma-btn-transition);
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

/* Button Hover Effects */
.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.elementor-button:hover,
.wp-block-button__link:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 94, 251, 0.3);
    color: var(--marthoma-btn-text);
}

/* Button Active State */
.btn:active,
button[type="submit"]:active,
input[type="submit"]:active,
.elementor-button:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* Button Focus State */
.btn:focus,
button[type="submit"]:focus,
input[type="submit"]:focus,
.elementor-button:focus {
    outline: 2px solid var(--marthoma-accent, #5251FF);
    outline-offset: 2px;
}

/* Shimmer Effect */
.btn::before,
.elementor-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.btn:hover::before,
.elementor-button:hover::before {
    left: 100%;
}

/* Button Variants */

/* Outline Button */
.btn--outline,
.elementor-button.elementor-button--outline {
    background-color: transparent;
    border: 2px solid var(--marthoma-btn-bg);
    color: var(--marthoma-btn-bg);
}

.btn--outline:hover,
.elementor-button.elementor-button--outline:hover {
    background-color: var(--marthoma-btn-bg);
    color: var(--marthoma-btn-text);
}

/* Dark Button */
.btn--dark {
    background-color: var(--marthoma-dark-navy, #072538);
}

.btn--dark:hover {
    box-shadow: 0 4px 12px rgba(7, 37, 56, 0.3);
}

/* Light Button */
.btn--light {
    background-color: var(--marthoma-light-blue, #B7D8FB);
    color: var(--marthoma-dark-navy, #072538);
}

.btn--light:hover {
    box-shadow: 0 4px 12px rgba(183, 216, 251, 0.5);
    color: var(--marthoma-dark-navy, #072538);
}

/* White Button */
.btn--white {
    background-color: #ffffff;
    color: var(--marthoma-button, #375EFB);
}

.btn--white:hover {
    background-color: var(--marthoma-light-gray, #F5F5F5);
    color: var(--marthoma-button, #375EFB);
}

/* Button Sizes */
.btn--small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn--large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Full Width Button */
.btn--full,
.btn--block {
    display: block;
    width: 100%;
}

/* Icon Button */
.btn--icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn--icon svg,
.btn--icon i {
    width: 1em;
    height: 1em;
}

/* Ripple Effect (added via JS) */
.btn .ripple,
.elementor-button .ripple,
button[type="submit"] .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Disabled State */
.btn:disabled,
.btn.disabled,
button:disabled,
input[type="submit"]:disabled,
.elementor-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Group */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Elementor Button Overrides */
.elementor-button-wrapper .elementor-button {
    font-family: var(--marthoma-font-heading) !important;
    font-weight: var(--marthoma-font-weight-button) !important;
}

.elementor-button .elementor-button-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Fix Elementor Form Submit Button Height Jump */
.elementor-field-type-submit .elementor-button {
    min-height: 44px;
    height: auto;
}

.elementor-field-type-submit .elementor-button .elementor-button-content-wrapper {
    min-height: inherit;
}

/* Prevent loading spinner from changing button height */
.elementor-field-type-submit .elementor-button .elementor-button-text {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
}

.elementor-field-type-submit .elementor-button .e-font-icon-svg {
    width: 16px;
    height: 16px;
}

/* Ensure shimmer effect doesn't affect button layout */
.elementor-field-type-submit .elementor-button::before {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .btn,
    .elementor-button {
        padding: 10px 20px;
    }

    .btn--large {
        padding: 14px 28px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }
}
