/* Button Block Styles */

.button-block-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 60px;
    padding: 0;
}

.button-element {
    /* Reset browser defaults */
    border: none;
    outline: none;
    text-decoration: none;
    background: none;
    margin: 0;
    
    /* Core button styling */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    
    /* Prevent text selection */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Accessibility */
    line-height: 1.2;
    white-space: nowrap;
}

.button-element:focus {
    outline: 2px solid var(--color-blue-accent);
    outline-offset: 2px;
}

.button-element:active {
    transform: translateY(1px);
}

/* Button Style Variants */
.button-element.btn-primary {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    box-shadow: 0 2px 4px rgba(210, 141, 93, 0.2);
}

.button-element.btn-primary:hover {
    background-color: #b8754a;
    border-color: #b8754a;
    box-shadow: 0 4px 8px rgba(210, 141, 93, 0.3);
}

.button-element.btn-secondary {
    background-color: #8b7070;
    color: white;
    border-color: #8b7070;
    box-shadow: 0 2px 4px rgba(139, 112, 112, 0.2);
}

.button-element.btn-secondary:hover {
    background-color: #74605e;
    border-color: #74605e;
    box-shadow: 0 4px 8px rgba(139, 112, 112, 0.3);
}

.button-element.btn-success {
    background-color: var(--color-success);
    color: white;
    border-color: var(--color-success);
    box-shadow: 0 2px 4px rgba(198, 159, 122, 0.2);
}

.button-element.btn-success:hover {
    background-color: #a68561;
    border-color: #a68561;
    box-shadow: 0 4px 8px rgba(198, 159, 122, 0.3);
}

.button-element.btn-danger {
    background-color: var(--color-error);
    color: white;
    border-color: var(--color-error);
    box-shadow: 0 2px 4px rgba(212, 101, 76, 0.2);
}

.button-element.btn-danger:hover {
    background-color: #b5402d;
    border-color: #b5402d;
    box-shadow: 0 4px 8px rgba(212, 101, 76, 0.3);
}

.button-element.btn-warning {
    background-color: #c69d39;
    color: white;
    border-color: #c69d39;
    box-shadow: 0 2px 4px rgba(198, 157, 57, 0.2);
}

.button-element.btn-warning:hover {
    background-color: #a5822e;
    border-color: #a5822e;
    box-shadow: 0 4px 8px rgba(198, 157, 57, 0.3);
}

.button-element.btn-info {
    background-color: #d28d5d;
    color: white;
    border-color: #d28d5d;
    box-shadow: 0 2px 4px rgba(210, 141, 93, 0.2);
}

.button-element.btn-info:hover {
    background-color: #b8754a;
    border-color: #b8754a;
    box-shadow: 0 4px 8px rgba(210, 141, 93, 0.3);
}

.button-element.btn-outline {
    background-color: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 2px 4px rgba(210, 141, 93, 0.1);
}

.button-element.btn-outline:hover {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    box-shadow: 0 4px 8px rgba(210, 141, 93, 0.2);
}

.button-element.btn-ghost {
    background-color: transparent;
    color: var(--color-text-light);
    border-color: transparent;
    box-shadow: none;
}

.button-element.btn-ghost:hover {
    background-color: var(--color-hover);
    color: var(--color-text);
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button Size Variants */
.button-element.btn-size-small {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
}

.button-element.btn-size-medium {
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 6px;
}

.button-element.btn-size-large {
    font-size: 18px;
    padding: 16px 32px;
    border-radius: 8px;
}

.button-element.btn-size-extra-large {
    font-size: 20px;
    padding: 20px 40px;
    border-radius: 10px;
}

/* Width variants */
.button-element[style*="width: 100%"] {
    width: 100%;
    justify-content: center;
}

.button-element[style*="width: 50%"] {
    width: 50%;
    justify-content: center;
}

/* Disabled state */
.button-element:disabled,
.button-element.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading state */
.button-element.loading {
    position: relative;
    color: transparent;
}

.button-element.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: button-spin 1s linear infinite;
}

@keyframes button-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ripple effect on click */
.button-element::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.button-element:active::before {
    width: 300px;
    height: 300px;
}

.button-element > * {
    position: relative;
    z-index: 1;
}

/* Icon support */
.button-element .icon {
    margin-right: 8px;
    font-size: 0.9em;
}

.button-element .icon:last-child {
    margin-right: 0;
    margin-left: 8px;
}

.button-element .icon:only-child {
    margin: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .button-element.btn-size-large {
        font-size: 16px;
        padding: 14px 28px;
    }
    
    .button-element.btn-size-extra-large {
        font-size: 18px;
        padding: 16px 32px;
    }
    
    .button-block-content {
        justify-content: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .button-element {
        border-width: 3px;
    }
    
    .button-element:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .button-element {
        transition: none;
    }
    
    .button-element::before {
        transition: none;
    }
    
    @keyframes button-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}