/**
 * DealerHub Vehicles Pro - Button Styles
 * All button variations and states
 */

/* ========================================
   BASE BUTTON STYLES
   ======================================== */

.dh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--dh-font-family);
    font-size: var(--dh-btn-font-size, 16px);
    font-weight: var(--dh-btn-font-weight, 600);
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 2px solid transparent;
    padding: var(--dh-btn-padding, 12px 24px);
    border-radius: var(--dh-btn-radius, 8px);
    transition: all var(--dh-transition-base);
    box-shadow: var(--dh-btn-shadow);
    min-height: 44px;
    min-width: 120px;
}

.dh-btn:focus {
    outline: 2px solid var(--dh-primary-color);
    outline-offset: 2px;
}

.dh-btn:disabled,
.dh-btn.dh-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   PRIMARY BUTTON
   ======================================== */

.dh-btn-primary {
    background-color: var(--dh-btn-primary-bg, var(--dh-primary-color, #f97316)) !important;
    color: var(--dh-btn-primary-text, #ffffff) !important;
    border-color: var(--dh-btn-primary-bg, var(--dh-primary-color, #f97316));
}

.dh-btn-primary:hover {
    background-color: var(--dh-primary-hover);
    border-color: var(--dh-primary-hover);
    color: var(--dh-text-white);
    box-shadow: var(--dh-btn-shadow-hover);
    transform: translateY(-1px);
}

.dh-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--dh-btn-shadow);
}

/* ========================================
   SECONDARY BUTTON
   ======================================== */

.dh-btn-secondary {
    background-color: var(--dh-btn-secondary-bg, transparent) !important;
    color: var(--dh-btn-secondary-text, var(--dh-text-primary, #1f2937)) !important;
    border-color: var(--dh-btn-secondary-border, var(--dh-primary-color, #f97316)) !important;
}

.dh-btn-secondary:hover {
    background-color: var(--dh-secondary-color);
    border-color: var(--dh-secondary-color);
    color: var(--dh-text-white);
    box-shadow: var(--dh-btn-shadow-hover);
    transform: translateY(-1px);
}

.dh-btn-secondary:active {
    transform: translateY(0);
    box-shadow: var(--dh-btn-shadow);
}

/* ========================================
   OUTLINE BUTTON
   ======================================== */

.dh-btn-outline {
    background-color: transparent;
    color: var(--dh-primary-color);
    border-color: var(--dh-primary-color);
}

.dh-btn-outline:hover {
    background-color: var(--dh-primary-color);
    border-color: var(--dh-primary-color);
    color: var(--dh-text-white);
    transform: translateY(-1px);
}

/* ========================================
   GHOST BUTTON
   ======================================== */

.dh-btn-ghost {
    background-color: transparent;
    color: var(--dh-text-primary);
    border-color: transparent;
    box-shadow: none;
}

.dh-btn-ghost:hover {
    background-color: var(--dh-bg-secondary);
    color: var(--dh-primary-color);
}

/* ========================================
   BUTTON SIZES
   ======================================== */

.dh-btn-sm {
    font-size: var(--dh-font-size-sm);
    padding: 8px 16px;
    min-height: 36px;
    min-width: 100px;
}

.dh-btn-lg {
    font-size: var(--dh-font-size-lg);
    padding: 16px 32px;
    min-height: 52px;
    min-width: 140px;
}

.dh-btn-xl {
    font-size: var(--dh-font-size-xl);
    padding: 20px 40px;
    min-height: 60px;
    min-width: 160px;
}

/* ========================================
   BUTTON BLOCK (FULL WIDTH)
   ======================================== */

.dh-btn-block {
    display: flex;
    width: 100%;
}

/* ========================================
   BUTTON GROUP
   ======================================== */

.dh-btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

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

.dh-btn-group-center {
    justify-content: center;
}

.dh-btn-group-start {
    justify-content: flex-start;
}

.dh-btn-group-end {
    justify-content: flex-end;
}

.dh-btn-group-between {
    justify-content: space-between;
}

/* ========================================
   BUTTON WITH ICON
   ======================================== */

.dh-btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dh-btn-icon svg,
.dh-btn-icon img {
    width: 20px;
    height: 20px;
}

.dh-btn-icon-only {
    min-width: auto;
    padding: 12px;
    aspect-ratio: 1;
}

/* ========================================
   LOADING STATE
   ======================================== */

.dh-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

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

@keyframes dh-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   WORDPRESS THEME COMPATIBILITY
   ======================================== */

/* Override WordPress default button styles */
.dealerhub-vehicles-container .dh-btn,
.dealerhub-vehicle-detail .dh-btn {
    background-image: none !important;
    text-shadow: none !important;
    box-shadow: var(--dh-btn-shadow) !important;
}

.dealerhub-vehicles-container .dh-btn:hover,
.dealerhub-vehicle-detail .dh-btn:hover {
    box-shadow: var(--dh-btn-shadow-hover) !important;
}

/* Ensure buttons don't inherit theme link styles */
.dh-btn,
.dh-btn:visited {
    text-decoration: none !important;
}

/* Reset common theme button overrides */
.entry-content .dh-btn,
.post-content .dh-btn,
article .dh-btn {
    margin: 0 !important;
    padding: var(--dh-btn-padding, 12px 24px) !important;
    line-height: 1.5 !important;
}
