/**
 * GenerateBlocks Global Styles - Buttons
 * ============================================================================
 *
 * This file contains button styles designed for GenerateBlocks Global Styles.
 * These classes can be applied via GenerateBlocks → Settings → Global Styles
 * or directly as CSS classes in GenerateBlocks patterns.
 *
 * BEM Structure:
 * - Block: .gbp-button (implicit via modifiers)
 * - Modifiers: --primary, --secondary, --tertiary
 * - States: :hover, :focus, :disabled, --loading
 *
 * Global Classes Available:
 * - gbp-button--primary   → Main action button (blue filled)
 * - gbp-button--secondary → Outline style button
 * - gbp-button--tertiary  → Subtle action button
 * - gbp-cta-button        → Navigation CTA button
 *
 * @package ADV
 * @version 3.1.0
 * @since   2.0.0 Original BEM structure
 * @since   3.0.0 Moved to global-styles directory for GenerateBlocks integration
 * @author  ADV Group
 */

/* ========================================
   1. PRIMARY BUTTON
   Global Style: gbp-button--primary
   ======================================== */

.gbp-button--primary {
	display: inline-block;
	padding: 12px 24px;

	/* Box Model */
	border: none;
	border-radius: 4px;
	color: var(--color-white);

	/* Stacked Transitions */
	transition:
		background-color 0.2s ease,
		transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
		box-shadow 0.25s ease-in-out;

	/* Display & Positioning */
	cursor: pointer;

	/* Colors & Typography */
	background-color: var(--accent);
	font-weight: var(--font-semibold);
	text-decoration: none;
}

/* GenerateBlocks override - ensure white text is visible */
.gb-text.gbp-button--primary,
a.gb-text.gbp-button--primary,
a.gbp-button--primary {
	color: var(--color-white) !important;
}

.gbp-button--primary:hover,
.gbp-button--primary:focus {
	transform: translateY(-2px);
	background-color: var(--accent-2);
	box-shadow: var(--shadow-md);
}

/* ========================================
   2. SECONDARY BUTTON
   Global Style: gbp-button--secondary
   ======================================== */

.gbp-button--secondary {
	display: inline-block;
	padding: 10px 20px;

	/* Box Model */
	border: 2px solid var(--accent);
	border-radius: 4px;
	color: var(--accent);

	/* Stacked Transitions */
	transition:
		background-color 0.25s ease,
		color 0.25s ease,
		border-color 0.3s ease,
		transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

	/* Colors & Typography */
	background-color: transparent;
	font-weight: var(--font-semibold);
	text-decoration: none;
}

.gbp-button--secondary:hover,
.gbp-button--secondary:focus {
	color: #fff;
	transform: translateY(-2px);
	background-color: var(--accent);
	border-color: var(--accent);
}

/* ========================================
   3. TERTIARY BUTTON
   Global Style: gbp-button--tertiary
   ======================================== */

.gbp-button--tertiary {
	display: inline-block;
	padding: 8px 16px;

	/* Box Model */
	border-radius: 4px;
	color: var(--color-white);

	/* Transition */
	transition: var(--transition-base);

	/* Colors & Typography */
	background-color: var(--base-3);
	font-size: 14px;
	font-weight: var(--font-medium);
	text-decoration: none;
}

.gbp-button--tertiary:hover,
.gbp-button--tertiary:focus {
	background-color: var(--base-2);
}

/* ========================================
   4. CTA BUTTON (Navigation)
   Global Style: gbp-cta-button
   ======================================== */

.gbp-cta-button {
	display: inline-flex;
	align-items: center;
	padding: 0.65rem 1.25rem;

	/* Colors */
	background: var(--accent);

	/* Box Model */
	border: none;
	border-radius: var(--border-radius-md);
	color: var(--color-white);

	/* Stacked Transitions */
	transition:
		background-color 0.2s ease,
		transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
		box-shadow 0.25s ease-in-out;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: var(--font-semibold);
	text-decoration: none;
}

/* GenerateBlocks override - ensure white text is visible */
.gb-text.gbp-cta-button,
a.gb-text.gbp-cta-button,
a.gbp-cta-button {
	color: #fff !important;
}

.gbp-cta-button:hover,
.gbp-cta-button:focus {
	background: var(--accent-2);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	outline: none;
}

/* ========================================
   5. BUTTON STATES
   ======================================== */

/* Disabled State */
.gbp-button--primary:disabled,
.gbp-button--secondary:disabled,
.gbp-button--tertiary:disabled,
.gbp-cta-button:disabled {
	transform: none;
	opacity: 0.6;
	cursor: not-allowed;
	box-shadow: none;
}

/* Loading State Modifier */
.gbp-button--loading {
	position: relative;
	opacity: 0.8;
	pointer-events: none;
}

.gbp-button--loading::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 1rem;
	width: 16px;
	height: 16px;
	border: 2px solid transparent;
	border-radius: 50%;
	margin-top: -8px;
	border-top-color: currentcolor;
	animation: button-spin 0.8s linear infinite;
}

/* ========================================
   6. BUTTON ANIMATION
   @keyframes must stay in CSS (not GB Global Styles)
   ======================================== */

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

/* ========================================
   7. DARK THEME
   ======================================== */

[data-theme='dark'] .gbp-button--primary {
	background-color: var(--accent);
}

[data-theme='dark'] .gbp-button--primary:hover,
[data-theme='dark'] .gbp-button--primary:focus {
	background-color: var(--accent-2);
}

[data-theme='dark'] .gbp-button--secondary {
	color: var(--accent-2);
	border-color: var(--accent-2);
}

[data-theme='dark'] .gbp-button--secondary:hover,
[data-theme='dark'] .gbp-button--secondary:focus {
	color: #fff;
	background-color: var(--accent-2);
	border-color: var(--accent-2);
}

[data-theme='dark'] .gbp-button--tertiary {
	color: var(--color-white);
	background-color: var(--slate-700);
}

[data-theme='dark'] .gbp-button--tertiary:hover,
[data-theme='dark'] .gbp-button--tertiary:focus {
	background-color: var(--slate-600);
}

/* ========================================
   8. RESPONSIVE
   ======================================== */

@media (width <= 767px) {
	/* Hide CTA button on mobile (menu toggle instead) */
	.gbp-cta-button {
		display: none;
	}

	/* Full-width buttons on mobile */
	.gbp-button--primary,
	.gbp-button--secondary {
		width: 100%;
		padding: 1rem 2rem;
	}
}
