/* ============================================
   RESQ+ ADVANCED UX/UI - WORLD CLASS
   Taking it to 9.3/10 level
   ============================================ */

/* ============================================
   1. SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    display: none !important;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 40px rgba(255, 59, 59, 0.4), 0 0 40px rgba(255, 59, 59, 0.3);
}

.scroll-to-top::before {
    content: '↑';
    font-size: 24px;
    color: white;
    font-weight: bold;
}

/* ============================================
   2. TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    transform: translateX(450px);
    animation: toast-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    position: relative;
    overflow: hidden;
}

.toast.success {
    border-left: 4px solid #38ef7d;
}

.toast.error {
    border-left: 4px solid #ff3b3b;
}

.toast.info {
    border-left: 4px solid #4facfe;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    color: #6B7280;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #1F2937;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #4facfe, #38ef7d);
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-slide-in {
    to {
        transform: translateX(0);
    }
}

@keyframes toast-progress {
    to {
        width: 100%;
    }
}

.toast.removing {
    animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toast-slide-out {
    to {
        transform: translateX(450px);
        opacity: 0;
    }
}

/* ============================================
   3. LOADING SKELETON
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* ============================================
   4. SECTION NAVIGATION DOTS (DISABLED)
   ============================================ */

.section-nav {
    display: none !important;
}

.section-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.section-nav-dot::before {
    content: attr(data-section);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.section-nav-dot:hover::before {
    opacity: 1;
}

.section-nav-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.3);
}

.section-nav-dot.active {
    background: #4facfe;
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.6);
}

/* ============================================
   5. MAGNETIC BUTTONS
   ============================================ */

.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   6. ADVANCED RIPPLE EFFECT
   ============================================ */

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    width: 0;
    height: 0;
    top: var(--y);
    left: var(--x);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ripple-effect.rippling::after {
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    to {
        width: 500px;
        height: 500px;
        opacity: 0;
    }
}

/* ============================================
   7. FORM VALIDATION STATES
   ============================================ */

.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1);
}

.form-input.valid {
    border-color: #38ef7d;
}

.form-input.invalid {
    border-color: #ff3b3b;
}

.form-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 6px;
    display: none;
    animation: shake 0.3s;
}

.form-input.invalid + .form-error {
    display: block;
}

.form-success {
    color: #38ef7d;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.form-input.valid + .form-error + .form-success {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ============================================
   8. LOADING BUTTON STATE
   ============================================ */

.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.8s linear infinite;
}

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

/* ============================================
   9. SUCCESS/ERROR ANIMATIONS
   ============================================ */

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #38ef7d;
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.success-checkmark .check-icon::before,
.success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: var(--gradient-night);
    transform: rotate(-45deg);
}

.success-checkmark .icon-line {
    height: 5px;
    background-color: #38ef7d;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.success-checkmark .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

/* ============================================
   10. EXIT INTENT POPUP
   ============================================ */

.exit-intent-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.exit-intent-popup.active {
    display: flex;
    animation: fade-in 0.3s ease;
}

.exit-intent-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 24px;
    max-width: 500px;
    text-align: center;
    color: white;
    position: relative;
    transform: scale(0.8);
    animation: popup-scale 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popup-scale {
    to {
        transform: scale(1);
    }
}

.exit-intent-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.exit-intent-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   11. KEYBOARD SHORTCUTS - REMOVED
   ============================================ */

/* Keyboard hint removed for professional appearance */

/* ============================================
   12. SMOOTH SCROLL INDICATOR
   ============================================ */

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    cursor: pointer;
    animation: fade-in-out 2s infinite;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 10px;
    margin-left: -3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    animation: scroll-down 2s infinite;
}

@keyframes scroll-down {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    40%, 60% {
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

@keyframes fade-in-out {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================
   13. MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .section-nav {
        display: none;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .keyboard-hint {
        display: none;
    }
    
    .exit-intent-content {
        margin: 20px;
        padding: 30px 20px;
    }
}

/* ============================================
   14. PERFORMANCE OPTIMIZATIONS
   ============================================ */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
