/**
 * Button Components
 * Enhanced button styles with gradients and interactions
 * Bootstrap 5 compatible overrides
 */

/* Base Button Enhancements */
.btn {
    border-radius: 0.375rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}


/* Button Size Variants */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-action {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Primary Button with Gradient */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
}

/* Success Button with Gradient */
.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
    border-color: var(--success-color);
}

/* Warning Button with Gradient */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    border-color: var(--warning-color);
    color: #212529;
}

/* Special Button: Remove Lesson */
.remove-lesson-btn {
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}


/* Desktop Hover Effects - Only on devices with hover capability */
@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    }

    .btn:active {
        transform: translateY(0);
    }

    .remove-lesson-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 0.125rem 0.25rem rgba(220, 53, 69, 0.2);
    }
}

/* Touch Device Behavior - No persistent hover/active states */
@media (hover: none) and (pointer: coarse) {
    /* Prevent all transform-based animations on touch devices
     * Issue #116: Transforms cause layout shifts and scrolling problems
     */
    .btn:hover,
    .btn:active,
    button:hover,
    button:active,
    [data-action]:hover,
    [data-action]:active {
        transform: none !important;
    }
    
    /* Issue #125: Touch feedback via JS-controlled class instead of :active
     * Fixes Webkit bug where :active state sticks after touch release
     * Managed by touch-feedback.js module
     */
    .btn-link.touch-active {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }
    
    /* Disable :active for .btn-link (handled by JS now) */
    .btn-link:active {
        opacity: 1;
    }
    
    /* Keep :active for buttons with background color (no sticky bug) */
    .btn-primary:active,
    .btn-success:active,
    .btn-warning:active,
    .btn-danger:active,
    .btn-outline-danger:active {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }
    
    /* Ensure minimum touch target size (Apple HIG: 44x44px) */
    .btn {
        min-height: 44px;
    }
    
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Mobile Responsive Button Adjustments */
@media (max-width: 768px) {
    .btn-action {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}
