/* Button Enhancement Styles - Common across all themes */
/* This file ensures consistent button styling and addresses HTML entity issues */

/* Enhanced button transitions and effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Ripple effect on click */
.btn::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.5) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Icon spacing in buttons */
.btn i, .btn svg {
    margin-right: 0.375rem;
    font-size: 0.875em;
    vertical-align: middle;
}

.btn i:last-child, .btn svg:last-child {
    margin-right: 0;
    margin-left: 0.375rem;
}

.btn i:first-child:last-child, .btn svg:first-child:last-child {
    margin: 0;
}

/* Loading state for buttons */
.btn.btn-loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.btn.btn-loading::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: currentColor;
    animation: btn-loading-spinner 0.6s linear infinite;
    color: white;
}

@keyframes btn-loading-spinner {
    to { transform: rotate(360deg); }
}

/* Enhanced focus states for accessibility */
.btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Button group styling */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

/* Form actions container enhancement */
.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Fix for HTML entities in buttons */
.btn {
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Common button icons */
.btn .fa-save::before,
.btn .fa-check::before,
.btn .fa-plus::before,
.btn .fa-edit::before,
.btn .fa-trash::before,
.btn .fa-times::before,
.btn .fa-arrow-left::before,
.btn .fa-arrow-right::before {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Ensure proper rendering of special characters */
.btn {
    font-feature-settings: "liga" 1;
    text-rendering: optimizeLegibility;
}

/* Mobile responsive buttons */
@media (max-width: 576px) {
    .form-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}