/**
 * Custom CSS overrides for NYCharters theme
 * Specifically targeting Gutenberg button classes to match theme button styles
 */

/* Target the Find a School section specifically */
#find-a-school .wp-block-buttons {
    /* Reset any unwanted styles from Gutenberg */
    margin: 0;
    padding: 0;
    display: block;
}

#find-a-school .wp-block-button {
    /* Reset any unwanted styles from Gutenberg */
    margin: 0;
    padding: 0;
    display: inline-block;
}

#find-a-school .wp-block-button__link.wp-element-button {
    /* Apply the btn btn--yellow styles */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 196px;
    height: 42px;
    padding: 10px 20px;
    gap: 10px;
    border-radius: 20px;
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    
    /* Yellow button specific styles */
    background-color: var(--color-quaternary, #eaaa00);
    color: var(--color-white, #ffffff) !important;
    
    /* Clean border styling */
    border: 1px solid var(--color-quaternary, #eaaa00);
    box-shadow: 0 0 0 1px var(--color-quaternary, #eaaa00);
    
    /* Required for ripple effect */
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Ripple effect pseudo-element */
#find-a-school .wp-block-button__link.wp-element-button::after {
    content: "";
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: var(--color-white, #ffffff);
    transition: width 0.5s ease-in-out, height 0.5s ease-in-out;
    transform: translate(-50%, -50%);
    z-index: -1;
    top: 70px;
    left: 50%;
    opacity: 0.95; /* Slightly transparent to blend better */
}

#find-a-school .wp-block-button__link.wp-element-button:hover {
    color: var(--color-quaternary, #eaaa00) !important;
    border: 0px solid var(--color-quaternary, #eaaa00);
    box-shadow: 0 0 0 1px var(--color-quaternary, #eaaa00);
    background-color: transparent; /* Ensure background is transparent on hover */
}

/* Expand the ripple on hover */
#find-a-school .wp-block-button__link.wp-element-button:hover::after {
    width: 225%;
    height: 562.5px;
}

/**
 * WP Store Locator Custom Button Styles
 * Phase 2 - Search/Reset Button Implementation
 */

/* Override inherited CSS rules that conflict with flexbox */
#wpsl-search-wrap div, 
#wpsl-search-btn {
    margin-right: 0 !important; /* Remove inherited margin-right */
    float: none !important; /* Remove inherited float */
}

/* Layout adjustments for better proportions */
#wpsl-search-wrap .col-one {
    /*width: 42% !important; */
}

#wpsl-search-wrap .col-two {
    width: 13.5% !important;
}

/* Ensure all columns are vertically aligned */
#wpsl-search-wrap .input-search-wrap-outer.search-cs {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Action buttons column takes remaining space */
.action-buttons-col {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

/* Action buttons container */
.wpsl-action-buttons {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: flex-end;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
    #wpsl-search-wrap .col-one {
        width: 100% !important;
        margin-bottom: 16px;
    }
    
    #wpsl-search-wrap .col-two {
        width: 32% !important;
    }
    
    .action-buttons-col {
        width: 100% !important;
        margin-top: 16px;
        justify-content: center;
    }
    
    .wpsl-action-buttons {
        justify-content: center;
        gap: 12px;
    }
}

/* Base div button styling - CLEAN APPROACH */
.wpsl-search-button,
.wpsl-reset-button {
    width: 60px;
    height: 60px;
    border-radius: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    user-select: none;
}

/* Keyboard navigation support for div buttons */
.wpsl-search-button:focus,
.wpsl-reset-button:focus {
    outline: 2px solid #0075BF;
    outline-offset: 2px;
}

.wpsl-search-button:hover,
.wpsl-reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wpsl-search-button:active,
.wpsl-reset-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure icons are properly sized */
.wpsl-search-button img,
.wpsl-reset-button img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    pointer-events: none;
    object-fit: contain;
}

/* Search button specific styling */
.wpsl-search-button {
    background-color: #D6ECF8;
}

.wpsl-search-button:hover {
    background-color: #c1dff5;
}

.wpsl-search-button:active {
    background-color: #abd2f2;
}

/* Reset button specific styling */
.wpsl-reset-button {
    background-color: #EAAA00;
    position: relative;
}

.wpsl-reset-button:hover {
    background-color: #d39a00;
}

.wpsl-reset-button:active {
    background-color: #bc8a00;
}

/* Button loading states (no animation needed with static images) */
.wpsl-search-button.searching,
.wpsl-reset-button.resetting {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}





/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .wpsl-action-buttons {
        justify-content: center;
        gap: 12px;
    }
    
    .wpsl-search-button,
    .wpsl-reset-button {
        width: 56px;
        height: 56px;
    }
    
    .wpsl-search-button img,
    .wpsl-reset-button img {
        width: 22px;
        height: 22px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .wpsl-search-button,
    .wpsl-reset-button {
        width: 50px;
        height: 50px;
    }
    
    .wpsl-search-button img,
    .wpsl-reset-button img {
        width: 20px;
        height: 20px;
    }
}
