/* ===== Button Design & Animation Enhancements ===== */

/* Fix square outline issue - CRITICAL FIX */
.btn,
.btn-primary,
.btn-outline,
.btn-secondary,
button,
[class*="btn"],
.nav-cta,
.nav-link-auth,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    /* Force rounded corners everywhere */
    border-radius: 50px !important;
    
    /* Fix square focus outline */
    outline: none !important;
    
    /* Ensure clicks work */
    position: relative;
    overflow: visible;
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none;
}

/* Enhanced focus styles for accessibility */
.btn:focus,
.btn:focus-visible,
button:focus,
button:focus-visible,
[class*="btn"]:focus,
[class*="btn"]:focus-visible {
    outline: none !important;
    border-radius: 50px !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4) !important;
    transform: translateY(-1px);
}

/* Primary button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none !important;
    border-radius: 50px !important;
    color: white;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: visible !important;
    z-index: 1;
}

/* Animated glow effect */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    border-radius: 50px !important;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: blur(8px);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 35px rgba(139, 92, 246, 0.5), 0 4px 15px rgba(99, 102, 241, 0.3);
    border-radius: 50px !important;
}

.btn-primary:hover::after {
    opacity: 0.6;
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.99);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Outline button enhancements */
.btn-outline {
    background: transparent;
    border: 2px solid rgba(139, 92, 246, 0.8) !important;
    border-radius: 50px !important;
    color: #8b5cf6;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 50px !important;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-outline:hover {
    border-color: transparent !important;
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
    border-radius: 50px !important;
}

.btn-outline:hover::before {
    opacity: 1;
}

.btn-outline:active {
    transform: translateY(-1px) scale(0.99);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navbar button improvements */
.nav-cta {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    color: white !important;
    padding: 0.625rem 1.75rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    margin: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.nav-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50px !important;
}

.nav-cta:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4) !important;
    border-radius: 50px !important;
}

.nav-cta:hover::before {
    opacity: 1;
}

.nav-cta:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 50px !important;
}

.nav-cta:focus {
    outline: 2px solid rgba(139, 92, 246, 0.5) !important;
    outline-offset: 2px !important;
    border-radius: 50px !important;
}

/* Hide icon inside purchase button */
.nav-cta i {
    display: none !important;
}

.nav-cta span {
    position: static !important;
}

.nav-link-auth:hover {
    transform: translateY(-2px) scale(1.05) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-link-auth:active {
    transform: translateY(0) scale(1.02) !important;
    background: rgba(255, 255, 255, 0.25) !important;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-link-auth:focus {
    outline: 2px solid rgba(139, 92, 246, 0.4) !important;
    outline-offset: 2px !important;
}

/* Download section button improvements */
.download-actions .btn {
    min-height: 56px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-actions .btn:hover {
    transform: translateY(-3px);
}

/* Modal button improvements */
.purchase-modal .btn,
.download-notification-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.purchase-modal .btn:hover,
.download-notification-btn:hover {
    transform: translateY(-2px);
}

/* Scroll to top button enhancement */
.scroll-to-top {
    border-radius: 50% !important;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.scroll-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

/* Carousel controls enhancement */
.carousel-dot {
    border-radius: 50% !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot:hover,
.carousel-dot.active {
    transform: scale(1.2);
}

/* Form button improvements */
.auth-form .btn,
input[type="submit"] {
    min-height: 48px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile menu toggle enhancement */
.mobile-menu-toggle {
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.05);
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ripple effect for buttons (only for non-primary buttons to avoid overflow issues) */
.btn-outline::before,
.btn-secondary::before {
    pointer-events: none;
}

/* Subtle pulse effect on active */
.btn:active {
    animation: button-press 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes button-press {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(0.99);
    }
}

/* Button group spacing */
.btn + .btn {
    margin-left: 1rem;
}

/* Responsive button adjustments */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .btn-lg {
        min-height: 52px;
        font-size: 1.1rem;
    }
    
    .btn + .btn {
        margin-left: 0;
        margin-top: 0.75rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-outline {
        border-width: 3px;
    }
    
    .btn:focus,
    .btn:focus-visible {
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6) !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn::before,
    .btn::after,
    .btn:hover,
    .btn:focus,
    .btn-primary,
    .btn-primary::after,
    .btn-outline::before {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .btn {
        background: transparent !important;
        color: #000 !important;
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }
}
