/* ========================================
   BUTTON STYLES
   Primary, Secondary, Danger, Edit, Delete
   ======================================== */

/* Buttons - Valerin Style */
button, .btn {
    background: linear-gradient(135deg, var(--valerin-red) 0%, var(--valerin-red-dark) 100%);
    border: none;
    color: var(--valerin-text-light);
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    box-shadow: 0 4px 12px var(--valerin-red-shadow);
    text-transform: none;
    letter-spacing: -0.025em;
}

/* Force uppercase for Edit/Delete buttons (override lowercase) */
.edit-btn,
.hero-edit-btn,
.edit-button,
button[onclick*="openEditProjectModal"],
button[onclick*="toggleEditForm"],
.btn-delete-project,
.hero-delete-btn,
.btn-danger,
.btn-delete-confirm,
.delete-document-btn,
.danger,
button[onclick*="deleteProject"] {
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
}

button:hover, .btn:hover {
    background: linear-gradient(135deg, var(--valerin-red-hover) 0%, var(--valerin-red-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--valerin-red-shadow);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--valerin-shadow);
}

button.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    min-height: 40px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button.danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

button.secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: 1px solid #4b5563;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    min-height: 40px;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button.secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107, 114, 128, 0.4);
}

/* Edit button specific styling */
button[onclick*="toggleEditForm"] {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: 1px solid #047857;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    min-height: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button[onclick*="toggleEditForm"]:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button[onclick*="toggleEditForm"]:before {
    content: "✏️ ";
    margin-right: 6px;
    font-size: 1rem;
}

/* Enhanced button groups */
.button-group {
	display: flex;
	gap: 8px;
	align-items: center;
}

/* Edit button styling - FIXED VERSION */
.edit-btn {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: none;
	box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
	position: relative;
	z-index: 1000;
	pointer-events: auto;
	display: inline-block;
	text-decoration: none;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.edit-btn:hover {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.edit-btn:active {
	background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
	transform: none;
}

/* Ensure all buttons are clickable */
button {
	position: relative;
	z-index: 10;
	pointer-events: auto;
	cursor: pointer;
}

/* Fix for flex containers that might be blocking clicks */
.button-group {
	position: relative;
	z-index: 10;
}

.button-group button {
	position: relative;
	z-index: 11;
}

/* DEBUG: Make edit buttons more visible and clickable */
.edit-btn {
	border: 2px solid #1d4ed8 !important;
	box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2) !important;
}

.edit-btn:hover {
	border-color: #1e40af !important;
	box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.3) !important;
}

/* Delete Button */
.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    z-index: 10;
}

.delete-btn:hover {
    opacity: 1;
    background: var(--danger-hover);
    transform: scale(1.1);
}

.delete-btn:active {
    transform: scale(0.95);
}

/* Add button styling */
.add-button {
    background: linear-gradient(135deg, var(--valerin-red) 0%, var(--valerin-red-dark) 100%);
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px var(--valerin-red-shadow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 44px;
}

.add-button:hover {
    background: linear-gradient(135deg, var(--valerin-red-hover) 0%, var(--valerin-red-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--valerin-red-shadow);
}

.add-button:before {
    content: "➕";
    font-size: 1rem;
    font-weight: bold;
}

/* Schema Edit Button - for customizing fields in sections */
.schema-edit-button {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
    min-height: 44px;
    position: relative;
}

.schema-edit-button:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
}

.schema-edit-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.schema-edit-button svg {
    stroke-width: 2.5;
}

/* Section Management Buttons - for editing/deleting sections */
.section-management-buttons {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.section-management-buttons:hover {
    opacity: 1;
}

.section-edit-btn,
.section-delete-btn {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    box-shadow: none;
}

.section-edit-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: none;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.section-delete-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
    transform: none;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.section-edit-btn svg,
.section-delete-btn svg {
    stroke-width: 2;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--card);
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-toggle {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-toggle:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Hero Edit Button */
.hero-edit-btn {
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	color: white;
	border: none;
	padding: 0.875rem 1.75rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.hero-edit-btn:hover {
	background: linear-gradient(135deg, #047857 0%, #065f46 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

/* Delete Project Modal Buttons */
.btn-delete-project {
    background: var(--danger);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-delete-project:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

.btn-delete-confirm {
    background: var(--danger);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    opacity: 0.5;
    pointer-events: none;
}

.btn-delete-confirm.enabled {
    opacity: 1;
    pointer-events: auto;
    background: var(--danger);
}

.btn-delete-confirm.enabled:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
}

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

/* Floating Action Button - Valerin Style */
.fab {
    background: var(--valerin-primary);
    color: var(--valerin-text-light);
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--valerin-shadow);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.fab:hover {
    background: var(--valerin-primary-hover);
    transform: scale(1.1);
    box-shadow: 0 12px 32px var(--valerin-shadow);
}
