/* ===============================================
   🚀 PREMIUM BUTTON SYSTEM - APPLE + GTA 6 LEVEL
   =============================================== */

/* ===== BASE BUTTON FOUNDATION ===== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    overflow: hidden;
    min-width: 140px;
    background: transparent;
    isolation: isolate;
    
    /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.btn:focus {
    outline: none;
}

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

/* ===== PRIMARY BUTTON - REVOLUTIONARY 3D DESIGN ===== */
.btn-primary {
    background: linear-gradient(135deg, 
        #007AFF 0%, 
        #5856D6 25%, 
        #AF52DE 50%, 
        #FF2D92 75%, 
        #007AFF 100%
    );
    background-size: 200% 200%;
    color: white;
    border: 2px solid transparent;
    box-shadow: 
        0 8px 25px rgba(0, 122, 255, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: primaryGradientShift 6s ease-in-out infinite;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        transparent 30%, 
        transparent 70%, 
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        rgba(255, 255, 255, 0.1) 0deg,
        transparent 60deg,
        transparent 300deg,
        rgba(255, 255, 255, 0.1) 360deg
    );
    border-radius: 50%;
    opacity: 0;
    animation: rotate 4s linear infinite;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.btn-primary:hover {
    transform: translateY(-4px) rotateX(5deg) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 122, 255, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation-play-state: paused;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover::after {
    opacity: 0.6;
}

.btn-primary:active {
    transform: translateY(-2px) rotateX(2deg) scale(0.99);
    box-shadow: 
        0 12px 25px rgba(0, 122, 255, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes primaryGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== GLASS BUTTON - ULTRA GLASSMORPHISM ===== */
.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-glass::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(0, 122, 255, 0.2) 0%, 
        transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 0;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 122, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-glass:hover::before {
    opacity: 1;
}

.btn-glass:hover::after {
    width: 300px;
    height: 300px;
}

.dark-mode .btn-glass {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dark-mode .btn-glass:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 122, 255, 0.4);
}

/* ===== SECONDARY BUTTON - ELEGANT OUTLINE ===== */
.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(var(--accent-primary-rgb, 0, 122, 255), 0.1) 0%, 
        transparent 100%
    );
    border-radius: inherit;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: -1;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(var(--accent-primary-rgb, 0, 122, 255), 0.6) 50%, 
        transparent 70%
    );
    background-size: 200% 200%;
    border-radius: inherit;
    opacity: 0;
    z-index: -2;
    animation: borderFlow 3s linear infinite;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(var(--accent-primary-rgb, 0, 122, 255), 0.2),
        0 6px 16px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-secondary:hover::after {
    opacity: 1;
}

@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== BUTTON CONTENT & EFFECTS ===== */
.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn:hover .btn-content {
    transform: translateY(-1px);
}

.btn-content i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.btn:hover .btn-content i {
    transform: translateX(2px);
}

/* ===== BUTTON SHINE EFFECT ===== */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%
    );
    transition: left 0.6s ease;
    z-index: 1;
    border-radius: inherit;
    opacity: 0;
}

.btn:hover .btn-shine {
    left: 100%;
    opacity: 1;
}

/* ===== BUTTON GLOW EFFECT ===== */
.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(var(--accent-primary-rgb, 0, 122, 255), 0.3) 0%, 
        transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 0;
    opacity: 0;
}

.btn:hover .btn-glow {
    width: 200px;
    height: 200px;
    opacity: 1;
}

/* ===== PROGRESS BUTTON ===== */
.btn-progress {
    position: relative;
    overflow: hidden;
}

.btn-progress .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--accent-primary), 
        var(--accent-secondary)
    );
    border-radius: 0 0 inherit inherit;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== SUCCESS BUTTON ===== */
.btn-success {
    background: linear-gradient(135deg, #32d74b, #30db5b);
    color: white;
    border: 2px solid transparent;
    box-shadow: 
        0 8px 25px rgba(50, 215, 75, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-success.active {
    transform: scale(1.05);
    box-shadow: 
        0 12px 35px rgba(50, 215, 75, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-success i {
    transition: transform 0.3s ease;
}

/* ===== 3D BUTTON ===== */
.btn-3d {
    background: linear-gradient(135deg, 
        var(--accent-primary), 
        var(--accent-secondary)
    );
    color: white;
    border: none;
    transform-style: preserve-3d;
    box-shadow: 
        0 6px 0 rgba(0, 0, 0, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 50%, 
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 0 rgba(0, 0, 0, 0.2),
        0 12px 35px rgba(0, 0, 0, 0.2);
}

.btn-3d:hover::before {
    opacity: 1;
}

.btn-3d:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 rgba(0, 0, 0, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ===== MORPHING BUTTON ===== */
.btn-morphing {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-morphing:hover {
    border-radius: 50px;
    padding: 0.875rem 3rem;
}

/* ===== PARTICLE BUTTON ===== */
.btn-particles {
    position: relative;
}

.btn-particles::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: particleFloat 2s ease-in-out infinite;
}

.btn-particles:hover::before {
    animation: particleBurst 0.6s ease-out;
}

@keyframes particleFloat {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) translateY(-10px); opacity: 1; }
}

@keyframes particleBurst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1.5); opacity: 0; }
}

/* ===== DISABLED STATE ===== */
.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.btn:disabled::before,
.btn:disabled::after,
.btn[disabled]::before,
.btn[disabled]::after {
    display: none;
}

/* ===== LOADING STATE ===== */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-content {
    opacity: 0.5;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: buttonSpin 1s linear infinite;
    z-index: 3;
}

@keyframes buttonSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== FORM SPECIFIC BUTTONS ===== */
.btn-form-submit {
    min-width: 180px;
    position: relative;
}

.btn-next,
.btn-back {
    min-width: 120px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* ===== CONTACT BUTTONS ===== */
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(var(--accent-primary-rgb, 0, 122, 255), 0.08);
    color: var(--accent-primary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(var(--accent-primary-rgb, 0, 122, 255), 0.2);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(var(--accent-primary-rgb, 0, 122, 255), 0.1) 50%, 
        transparent 100%
    );
    transition: left 0.5s ease;
}

.contact-btn:hover {
    background: rgba(var(--accent-primary-rgb, 0, 122, 255), 0.15);
    transform: translateX(6px);
    box-shadow: 0 8px 20px rgba(var(--accent-primary-rgb, 0, 122, 255), 0.2);
}

.contact-btn:hover::before {
    left: 100%;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn::before,
    .btn::after,
    .btn-shine,
    .btn-glow,
    .btn-progress {
        animation: none !important;
        transition: none !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
}

/* ===== DARK MODE ADJUSTMENTS ===== */
.dark-mode .btn-secondary {
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .btn-secondary:hover {
    border-color: var(--accent-primary);
}

.dark-mode .btn-back {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .btn-back:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    .btn-form-submit {
        min-width: 160px;
    }
    
    .btn-next,
    .btn-back {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        min-width: 100px;
    }
    
    .btn-content {
        gap: 0.375rem;
    }
} 