/* ============================================
   TUAI Buttons Module - Reusable Button Styles
   Shared button components across the site
   ============================================ */

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2vw, 16px) clamp(28px, 4vw, 40px);
    border-radius: 50px;
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.97);
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg,
        var(--primary-100) 0%,
        #ff9d42 100%);
    color: white;
    box-shadow:
        0 6px 20px rgba(255, 122, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 10px 30px rgba(255, 122, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(135deg,
        #2c3e50 0%,
        #34495e 100%);
    color: white;
    box-shadow:
        0 6px 20px rgba(44, 62, 80, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 10px 30px rgba(44, 62, 80, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--primary-100);
    border: 2px solid var(--primary-100);
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.1);
}

.btn-outline:hover {
    background: var(--primary-100);
    color: white;
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(255, 122, 0, 0.3),
        0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Submit Button (Large) */
.submit-btn,
.btn-submit {
    background: linear-gradient(135deg,
        var(--primary-100) 0%,
        #ff9d42 100%);
    color: white;
    padding: clamp(14px, 2.5vw, 18px) clamp(40px, 6vw, 60px);
    border: none;
    border-radius: 50px;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 25px rgba(255, 122, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.submit-btn:hover,
.btn-submit:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 12px 35px rgba(255, 122, 0, 0.4),
        0 6px 18px rgba(0, 0, 0, 0.15);
}

.submit-btn:disabled,
.btn-submit:disabled {
    background: linear-gradient(135deg,
        #cccccc 0%,
        #b3b3b3 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.submit-btn:disabled:hover,
.btn-submit:disabled:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Navigation Buttons (Form Steps, etc.) */
.btn-next,
.btn-prev {
    background: linear-gradient(135deg,
        var(--primary-100) 0%,
        var(--primary-200) 100%);
    color: white;
    padding: clamp(10px, 2vw, 14px) clamp(25px, 4vw, 35px);
    border-radius: 50px;
    border: none;
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.25);
}

.btn-next:hover,
.btn-prev:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.35);
}

.btn-prev {
    background: linear-gradient(135deg,
        #6c757d 0%,
        #5a6268 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.25);
}

.btn-prev:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.35);
}

/* CTA Buttons */
.cta-btn,
.custom-btn {
    background: linear-gradient(135deg,
        var(--primary-100) 0%,
        var(--primary-200) 100%);
    color: white;
    padding: clamp(12px, 2.5vw, 16px) clamp(30px, 5vw, 45px);
    border-radius: 50px;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    box-shadow:
        0 8px 24px rgba(255, 122, 0, 0.3),
        0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cta-btn::before,
.custom-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    transition: left 0.6s ease;
}

.cta-btn:hover,
.custom-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 12px 35px rgba(255, 122, 0, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.15);
}

.cta-btn:hover::before,
.custom-btn:hover::before {
    left: 100%;
}

/* Tool Card Button */
.tool-btn {
    background: linear-gradient(135deg,
        var(--primary-100) 0%,
        var(--primary-200) 100%);
    color: white;
    padding: clamp(10px, 2vw, 14px) clamp(22px, 4vw, 32px);
    border-radius: 50px;
    font-size: clamp(0.9rem, 1.7vw, 1rem);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 10px);
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.tool-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.tool-btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 25px rgba(255, 122, 0, 0.4);
}

.tool-btn:hover::before {
    animation: shine 0.8s ease;
}

@keyframes shine {
    0% {
        right: -50%;
    }
    100% {
        right: 150%;
    }
}

/* Language Toggle Buttons */
.page-lang-btn {
    padding: clamp(10px, 2vw, 14px) clamp(24px, 4vw, 38px);
    border: 2px solid var(--primary-100);
    background: white;
    color: var(--primary-100);
    border-radius: 50px;
    cursor: pointer;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(255, 122, 0, 0.15);
}

.page-lang-btn.active {
    background: linear-gradient(135deg,
        var(--primary-100),
        var(--primary-200));
    color: white;
    box-shadow:
        0 6px 20px rgba(255, 122, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.08);
    border-color: var(--primary-200);
}

.page-lang-btn:hover:not(.active) {
    background: linear-gradient(135deg,
        var(--primary-200),
        #ff9d42);
    color: white;
    border-color: var(--primary-200);
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(255, 122, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-lang-btn:active {
    transform: scale(1.02);
}

/* Icon Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(40px, 7vw, 50px);
    height: clamp(40px, 7vw, 50px);
    border-radius: 50%;
    background: linear-gradient(135deg,
        var(--primary-100) 0%,
        var(--primary-200) 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.25);
}

.btn-icon:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 18px rgba(255, 122, 0, 0.35);
}

/* Small Button */
.btn-sm {
    padding: clamp(8px, 1.5vw, 10px) clamp(18px, 3vw, 24px);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
}

/* Large Button */
.btn-lg {
    padding: clamp(16px, 3vw, 20px) clamp(48px, 7vw, 70px);
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
}

/* Wide Button */
.btn-wide {
    width: 100%;
    justify-content: center;
}

/* Gradient Variations */
.btn-gradient-cyan {
    background: linear-gradient(135deg, #00acc1, #0097a7);
    box-shadow: 0 6px 20px rgba(0, 172, 193, 0.3);
}

.btn-gradient-cyan:hover {
    box-shadow: 0 10px 30px rgba(0, 172, 193, 0.4);
}

.btn-gradient-purple {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.3);
}

.btn-gradient-purple:hover {
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.4);
}

.btn-gradient-green {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.btn-gradient-green:hover {
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.4);
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: clamp(10px, 2vw, 15px);
    align-items: center;
    flex-wrap: wrap;
}

.btn-group-center {
    justify-content: center;
}

.btn-group-right {
    justify-content: flex-end;
}

/* Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-spin 0.6s linear infinite;
}

@keyframes button-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 10px 24px;
        font-size: 0.95rem;
    }

    .submit-btn,
    .btn-submit {
        padding: 12px 35px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .btn,
    .cta-btn,
    .custom-btn {
        width: 100%;
        justify-content: center;
    }

    .btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .cta-btn:hover,
    .custom-btn:hover {
        transform: none;
    }
}

/* Accessibility */
.btn:focus-visible {
    outline: 3px solid rgba(255, 122, 0, 0.5);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn::before,
    .submit-btn,
    .cta-btn,
    .custom-btn {
        transition: none;
        animation: none;
    }
}
