/**
 * ACFE Form Pagination Styles
 * 
 * @package HTPXLS_ACFE_Form_Pages
 * @since 0.1.0
 */

/* ==========================================================================
   Page Field Markers (hidden)
   ========================================================================== */

.acf-field-hp-acfe-page {
    display: none !important;
}

/* ==========================================================================
   Page Wrap Container (created by JavaScript)
   ========================================================================== */

.acfe-page-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 30px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    overflow: hidden;
}

/* ==========================================================================
   Page Buttons (created by JavaScript)
   ========================================================================== */

.acfe-page-button {
    position: relative;
    flex: 1 1 auto;
    min-width: 120px;
    padding: 15px 20px;
    background: #f9f9f9;
    color: #666;
    text-align: center;
    text-decoration: none;
    border-right: 1px solid #ddd;
    transition: all 0.3s ease;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.acfe-page-button:last-child {
    border-right: none;
}

.acfe-page-button:hover {
    color: inherit;
    text-decoration: none;
}

.acfe-page-button:focus {
    outline: 2px solid #009bdc;
    outline-offset: -2px;
}

/* Page Number */
.acfe-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: #ddd;
    color: #888;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

/* Page Title */
.acfe-page-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Page States
   ========================================================================== */

/* Enabled (clickable) pages */
.acfe-page-button.acfe-page-enabled {
    background: #fff;
    color: #333;
    cursor: pointer;
}

.acfe-page-button.acfe-page-enabled:hover {
    background: #f5f5f5;
}

.acfe-page-button.acfe-page-enabled .acfe-page-number {
    background: #009bdc;
    color: #fff;
}

/* Current page */
.acfe-page-button.acfe-page-current {
    background: #009bdc;
    color: #fff;
    cursor: default;
}

.acfe-page-button.acfe-page-current:hover {
    background: #009bdc;
}

.acfe-page-button.acfe-page-current .acfe-page-number {
    background: #fff;
    color: #009bdc;
}

.acfe-page-button.acfe-page-current .acfe-page-title {
    font-weight: 600;
}

/* Disabled pages */
.acfe-page-button.acfe-page-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.acfe-page-button.acfe-page-disabled:hover {
    background: #f9f9f9;
}

/* ==========================================================================
   Page Navigation (created by JavaScript)
   ========================================================================== */

.acfe-previous-button {
    margin-right: 2rem;
    max-width: 100px;
}


/* ==========================================================================
   Form Submit Area
   ========================================================================== */

.acf-form-submit,
.acfe-form-submit {
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #ddd;
}

/* ==========================================================================
   Paginated Form State
   ========================================================================== */

.acfe-form-paginated {
    position: relative;
}

/* Loading state */
.acfe-form-paginated.acfe-form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.acfe-form-paginated.acfe-form-loading .acfe-previous-button,
.acfe-form-paginated.acfe-form-loading .acfe-next-button {
    cursor: wait;
}


.acfe-page-navigation {
    display: flex;
}

.acfe-page-navigation > * {
    flex-grow: 1;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Stack page buttons on mobile */
    .acfe-page-wrap {
        flex-direction: column;
    }
    
    .acfe-page-button {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .acfe-page-button:last-child {
        border-bottom: none;
    }
    
    /* Stack navigation buttons */
    .acfe-page-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .acfe-previous-button,
    .acfe-next-button {
        width: 100%;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    /* Smaller text on very small screens */
    .acfe-page-title {
        font-size: 13px;
    }
    
    .acfe-page-number {
        font-size: 12px;
        min-width: 20px;
        height: 20px;
    }
    
    .acfe-page-button {
        padding: 12px 15px;
    }
    
    .acfe-previous-button,
    .acfe-next-button {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .acfe-page-wrap,
    .acfe-page-navigation {
        display: none !important;
    }
    
    .acf-field-hp-acfe-page {
        display: none !important;
    }
    
    /* Show all fields when printing */
    .acf-field {
        display: block !important;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Screen reader text */
.acfe-page-button .screen-reader-text,
.acfe-previous-button .screen-reader-text,
.acfe-next-button .screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .acfe-page-button,
    .acfe-previous-button,
    .acfe-next-button {
        transition: none;
    }
    
    html,
    body {
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .acfe-page-wrap {
        border: 2px solid currentColor;
    }
    
    .acfe-page-button {
        border-right: 2px solid currentColor;
    }
    
    .acfe-page-button.acfe-page-current {
        outline: 2px solid currentColor;
    }
}

/* ==========================================================================
   Focus Management
   ========================================================================== */

/* Clear focus ring for mouse users */
.acfe-page-button:focus:not(:focus-visible),
.acfe-previous-button:focus:not(:focus-visible),
.acfe-next-button:focus:not(:focus-visible) {
    outline: none;
}

/* Show focus ring for keyboard users */
.acfe-page-button:focus-visible,
.acfe-previous-button:focus-visible,
.acfe-next-button:focus-visible {
    outline: 2px solid #009bdc;
    outline-offset: 2px;
}

/* ==========================================================================
   ACF Spinner Integration
   ========================================================================== */

.acf-spinner.is-active {
    display: inline-block;
    margin-left: 10px;
}

/* ==========================================================================
   Animations (optional enhancement)
   ========================================================================== */

@keyframes acfe-page-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animate fields when page changes */
.acfe-form-paginated .acf-field {
    animation: acfe-page-fade-in 0.3s ease-out;
}

/* Disable animation for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .acfe-form-paginated .acf-field {
        animation: none;
    }
}

.acfe-form {
    /*margin-top: 2rem;*/
}

.acf-fields > .acf-field {
    border-top: none;
}


.acf-field.acf-field-group {
    border-top: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.acf-field > .acf-label {
    font-size: 1rem;
    color: #363636;
    font-weight: 400;
    margin-bottom: 0;
}

.acf-field.acf-field-group > .acf-label {
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    background: white;
    display: inline-block;
    margin-left: 1rem;
    padding: 0 .4rem;
}

.acf-field.acf-field-group > .acf-input {
    margin-top: -1.25rem;
}

.acf-field.acf-field-group > .acf-input > .acf-fields {
    padding-top: 1rem;
}

.acf-field.acf-field-group[data-name="consent"] > .acf-input > .acf-fields {
    padding-top: 0;
}

.acf-field .acf-input input,
.acf-field .acf-input select {
    padding: 8px 10px;
    font-family: inherit;
    font-size: 100%;
    line-height: 1;
    font-weight: 600;
    border: 1px solid #009bdc;
    background-color: rgba(0,0,0,0);
}

.acf-fields.-border {
    border: 1px solid #ebebeb;
}

ul.acf-checkbox-list li {
    font-size: inherit;
    line-height: inherit;
    padding: 0;
}

ul.acf-checkbox-list li:before {
    display: none;
}


.acf-field.acfe-no-label > .acf-label > p.description,
.acf-field p.description {
    font-size: 1.1rem;
    line-height: 31px;
    margin-bottom: 1rem;
    color: initial;
}


.acf-field.acf-field-group[data-name="consent"] > .acf-label > p.description, {
    font-size: 1.25rem;
}