/**
 * Button Contrast & Clickability Fixes
 * Makes all buttons clearly clickable with proper contrast
 */

/* 1. Base Button Improvements - Make ALL buttons look clickable */
.btn,
button,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"] {
    /* Ensure minimum touch target size */
    min-height: 44px !important;
    min-width: 44px !important;
    
    /* Add depth with shadow */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    
    /* Smooth transitions for interactive feedback */
    transition: all 0.2s ease !important;
    
    /* Ensure pointer cursor */
    cursor: pointer !important;
    
    /* Strong borders for definition */
    border-width: 1px !important;
    border-style: solid !important;
    
    /* Ensure text is centered and readable */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    
    /* Prevent text selection on click */
    user-select: none !important;
    -webkit-user-select: none !important;
    
    /* Add subtle gradient for depth */
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(0,0,0,0.1)) !important;
}

/* 2. Primary Button - Strong contrast with brand blue */
.btn-primary {
    background-color: #0F75BD !important;
    border-color: #0D6AAD !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-primary:hover {
    background-color: #0D6AAD !important;
    border-color: #0B5E9A !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

.btn-primary:active {
    background-color: #0B5E9A !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

.btn-primary:focus {
    outline: 3px solid rgba(15, 117, 189, 0.5) !important;
    outline-offset: 2px !important;
}

/* 3. Secondary Button - Brand pink with white text */
.btn-secondary {
    background-color: #F72C93 !important;
    border-color: #E61A81 !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-secondary:hover {
    background-color: #E61A81 !important;
    border-color: #D5086F !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

.btn-secondary:active {
    background-color: #D5086F !important;
    transform: translateY(0) !important;
}

.btn-secondary:focus {
    outline: 3px solid rgba(247, 44, 147, 0.5) !important;
    outline-offset: 2px !important;
}

/* 4. Success Button - Green with white text */
.btn-success {
    background-color: #198754 !important;
    border-color: #157347 !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-success:hover {
    background-color: #157347 !important;
    border-color: #146C43 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* 5. Danger Button - Red with white text */
.btn-danger {
    background-color: #DC3545 !important;
    border-color: #C82333 !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-danger:hover {
    background-color: #C82333 !important;
    border-color: #BD2130 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* 6. Warning Button - Yellow with BLACK text for contrast */
.btn-warning {
    background-color: #FFC107 !important;
    border-color: #F5B800 !important;
    color: #000000 !important; /* Black text on yellow */
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.btn-warning:hover {
    background-color: #F5B800 !important;
    border-color: #E0A800 !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* 7. Info Button - Light blue with BLACK text for contrast */
.btn-info {
    background-color: #0DCAF0 !important;
    border-color: #0BACCE !important;
    color: #000000 !important; /* Black text for contrast */
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.btn-info:hover {
    background-color: #0BACCE !important;
    border-color: #0A9DBD !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* 8. Light Button - Light gray with DARK text */
.btn-light {
    background-color: #F8F9FA !important;
    border-color: #DEE2E6 !important;
    color: #212529 !important; /* Dark text for contrast */
}

.btn-light:hover {
    background-color: #E2E6EA !important;
    border-color: #D3D9DF !important;
    color: #212529 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* 9. Dark Button - Dark with white text */
.btn-dark {
    background-color: #212529 !important;
    border-color: #191C1F !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.btn-dark:hover {
    background-color: #191C1F !important;
    border-color: #0C0E10 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* 10. Outline Buttons - Strong borders and proper contrast */
.btn-outline-primary {
    background-color: transparent !important;
    border: 2px solid #0F75BD !important;
    color: #0F75BD !important;
}

.btn-outline-primary:hover {
    background-color: #0F75BD !important;
    border-color: #0F75BD !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(15, 117, 189, 0.3) !important;
}

.btn-outline-secondary {
    background-color: transparent !important;
    border: 2px solid #F72C93 !important;
    color: #F72C93 !important;
}

.btn-outline-secondary:hover {
    background-color: #F72C93 !important;
    border-color: #F72C93 !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(247, 44, 147, 0.3) !important;
}

.btn-outline-success {
    background-color: transparent !important;
    border: 2px solid #198754 !important;
    color: #198754 !important;
}

.btn-outline-success:hover {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
}

.btn-outline-danger {
    background-color: transparent !important;
    border: 2px solid #DC3545 !important;
    color: #DC3545 !important;
}

.btn-outline-danger:hover {
    background-color: #DC3545 !important;
    border-color: #DC3545 !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
}

.btn-outline-warning {
    background-color: transparent !important;
    border: 2px solid #FFC107 !important;
    color: #CC9A00 !important; /* Darker yellow for contrast */
}

.btn-outline-warning:hover {
    background-color: #FFC107 !important;
    border-color: #FFC107 !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
}

.btn-outline-info {
    background-color: transparent !important;
    border: 2px solid #0DCAF0 !important;
    color: #0A9DBD !important; /* Darker blue for contrast */
}

.btn-outline-info:hover {
    background-color: #0DCAF0 !important;
    border-color: #0DCAF0 !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
}

/* 11. Link Buttons - Make them look clickable */
.btn-link {
    color: #0F75BD !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    box-shadow: none !important;
    border: none !important;
}

.btn-link:hover {
    color: #0D6AAD !important;
    text-decoration-thickness: 2px !important;
    transform: none !important;
}

/* 12. Button Sizes - Ensure all sizes are clickable */
.btn-sm {
    min-height: 36px !important;
    font-size: 0.875rem !important;
    padding: 0.25rem 0.75rem !important;
}

.btn-lg {
    min-height: 56px !important;
    font-size: 1.25rem !important;
    padding: 0.75rem 1.5rem !important;
}

/* 13. Disabled States - Clear but still visible */
.btn:disabled,
.btn.disabled,
button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    
    /* Add diagonal stripes to show disabled state */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1) 10px,
        rgba(0, 0, 0, 0.1) 10px,
        rgba(0, 0, 0, 0.1) 20px
    ) !important;
}

.btn:disabled:hover,
.btn.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* 14. Active/Pressed State */
.btn:active:not(:disabled):not(.disabled) {
    transform: translateY(1px) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

/* 15. Focus States - Clear keyboard navigation */
.btn:focus,
button:focus,
input[type="submit"]:focus,
input[type="button"]:focus {
    outline: 3px solid currentColor !important;
    outline-offset: 2px !important;
    z-index: 1 !important;
}

/* 16. Button Groups - Maintain clickability */
.btn-group > .btn {
    box-shadow: none !important; /* Remove individual shadows */
}

.btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; /* Group shadow */
}

.btn-group > .btn:hover {
    z-index: 1 !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

/* 17. Icon Buttons - Ensure icons are visible */
.btn i,
.btn svg,
.btn .fa,
.btn .fas,
.btn .far,
.btn .fab {
    pointer-events: none !important; /* Prevent icon from blocking clicks */
    vertical-align: middle !important;
}

/* Icon-only buttons need clear boundaries */
.btn.btn-icon,
.btn[aria-label]:not(.btn-text) {
    padding: 0.5rem !important;
    min-width: 44px !important;
    min-height: 44px !important;
}

/* 18. Special Button States */
.btn.active,
.btn:active,
.btn[aria-pressed="true"] {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

/* 19. Loading State Buttons */
.btn.loading,
.btn[disabled].loading {
    color: transparent !important;
    position: relative !important;
}

.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: button-loading-spinner 1s linear infinite;
}

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

/* 20. Custom DNA Romance Button Styles */
.btn-dna-primary {
    background: linear-gradient(135deg, #0F75BD 0%, #0D6AAD 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 4px 6px rgba(15, 117, 189, 0.3) !important;
}

.btn-dna-secondary {
    background: linear-gradient(135deg, #F72C93 0%, #E61A81 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 4px 6px rgba(247, 44, 147, 0.3) !important;
}

/* 21. High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px !important;
        font-weight: bold !important;
    }
    
    .btn:focus {
        outline-width: 4px !important;
    }
}

/* 22. Print Styles */
@media print {
    .btn {
        border: 2px solid currentColor !important;
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}