/**
 * FILE: page_styles/userNudge.css
 * DATE: 2025-01-17
 * VERSION: 1.5 - LAUNCH READY (Simplified)
 * DESCRIPTION: EZ-Nudge System Styles - Minimal tooltips, no images
 * 
 * CHANGES v1.5 (THIS VERSION - LAUNCH READY):
 *   ✅ NO IMAGES - Removed all image styling
 *   ✅ SMALLER - 160px desktop, 140px mobile (naturally compact)
 *   ✅ SIMPLER - Only title and CTA text
 *   ✅ CLEAN - No swish animations (instant display)
 *   ✅ TIGHT - Minimal padding for compact look
 * 
 * CHANGES v1.4:
 *   - Tooltip size reduced to 75% (210px desktop, 187px mobile)
 *   - Swish animations added
 *   - Countdown timer bar styling
 */

/* ============================================
   CSS Variables & Root Configuration
   ============================================ */
:root {
    /* EZ-Nudge Colors */
    --ez-primary: #667eea;
    --ez-secondary: #764ba2;
    --ez-warning: #ff6b6b;
    --ez-success: #5CB85C;
    --ez-info: #3498db;
    
    /* Tooltip Colors - Simplified */
    --ez-tooltip-bg: #fff8e1;
    --ez-tooltip-border: #ffab40;
    --ez-tooltip-title: #d84315;
    --ez-tooltip-cta-bg: #ef5350;
    
    /* Animation Timing */
    --ez-pulse-duration: 1.5s;
    --ez-transition: 0.3s;
    
    /* Positioning Offsets */
    --offset-x: 20px;
    --offset-y: 0px;
}

/* ============================================
   Base Component Styles
   ============================================ */
ez-nudge-button {
    position: relative;
    display: inline-block;
    transition: all var(--ez-transition) ease;
}

/* State Classes for Visual Feedback */
ez-nudge-button.state-init {
    /* Initial state - no special styling */
}

ez-nudge-button.state-count {
    /* Nudging state */
}

ez-nudge-button.state-wait {
    /* Waiting state */
}

ez-nudge-button.state-hover {
    /* Hover state */
}

ez-nudge-button.state-leave {
    /* Leave state - brief flash */
    animation: leave-flash 0.3s ease;
}

/* ============================================
   Nudge Animation (Pulse Effect)
   ============================================ */
@keyframes pulse-nudge {
    0% { 
        transform: scale(1); 
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.02); 
        filter: brightness(1.1);
    }
    100% { 
        transform: scale(1); 
        filter: brightness(1);
    }
}

@keyframes leave-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

ez-nudge-button.nudge-active {
    animation: pulse-nudge var(--ez-pulse-duration) ease-in-out infinite;
}

/* ============================================
   Tooltip Base Styles - SIMPLIFIED
   NO IMAGES = Naturally smaller
   ============================================ */
.ez-tooltip {
    position: absolute;
    background: var(--ez-tooltip-bg);
    border: 3px solid var(--ez-tooltip-border);
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    width: 160px;  /* SMALLER: No image needed */
    animation: tooltip-appear 0.2s ease;
    pointer-events: auto;
}

@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Content - MINIMAL PADDING
   ============================================ */
.ez-tooltip-content {
    padding: 8px;  /* Tight padding */
    text-align: center;
}

/* ============================================
   Title - SIMPLE, NO ANIMATION
   ============================================ */
.ez-tooltip-title {
    font-weight: 600;
    color: var(--ez-tooltip-title);
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.3;
}

/* ============================================
   CTA Button - SIMPLE, NO ANIMATION
   ============================================ */
.ez-tooltip-cta {
    padding: 8px 12px;
    background: var(--ez-tooltip-cta-bg);
    color: white;
    border-radius: 6px;
    margin-top: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--ez-transition) ease;
    font-size: 12px;
}

.ez-tooltip-cta:hover {
    background: #f44336;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 83, 80, 0.3);
}

/* ============================================
   Tooltip Arrow (Directional)
   ============================================ */
.ez-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--ez-tooltip-bg);
    border: 3px solid var(--ez-tooltip-border);
    transform: rotate(45deg);
}

/* ============================================
   Desktop Positioning Classes
   ============================================ */

/* Right Position (Default) */
.ez-tooltip.tooltip-right {
    left: calc(100% + var(--offset-x));
    top: 50%;
    transform: translateY(-50%);
}

.ez-tooltip.tooltip-right .ez-tooltip-arrow {
    left: -11px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-right: none;
    border-top: none;
}

/* Left Position */
.ez-tooltip.tooltip-left {
    right: calc(100% + var(--offset-x));
    top: 50%;
    transform: translateY(-50%);
}

.ez-tooltip.tooltip-left .ez-tooltip-arrow {
    right: -11px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-left: none;
    border-bottom: none;
}

/* Top Position */
.ez-tooltip.tooltip-top {
    bottom: calc(100% + var(--offset-y) + 10px);
    left: 50%;
    transform: translateX(-50%);
}

.ez-tooltip.tooltip-top .ez-tooltip-arrow {
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-top: none;
    border-left: none;
}

/* Bottom Position - ANCHORED TO BUTTON */
.ez-tooltip.tooltip-bottom {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: auto !important;
    right: auto !important;
    margin-top: 2px !important;
    z-index: 10001 !important;
}

.ez-tooltip.tooltip-bottom .ez-tooltip-arrow {
    top: -11px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-bottom: none;
    border-right: none;
}

/* ============================================
   Mobile Positioning - SIMPLIFIED
   ============================================ */
@media (max-width: 768px) {
    .ez-tooltip {
        width: 140px;  /* Even smaller on mobile */
        font-size: 12px;
    }
    
    .ez-tooltip-title {
        font-size: 12px;
    }
    
    .ez-tooltip-cta {
        font-size: 11px;
        padding: 7px 10px;
    }
    
    /* Mobile uses same anchored positioning as desktop */
    .ez-tooltip.tooltip-mobile {
        position: fixed;
    }
    
    /* Hide arrows on mobile */
    .tooltip-mobile .ez-tooltip-arrow {
        display: none;
    }
}

/* ============================================
   Countdown Timer Bar - COMPACT
   ============================================ */
.countdown-container {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 171, 64, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 171, 64, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.countdown-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #f44336);
    border-radius: 3px;
    transition: width 1s linear;
    width: 100%;
}

.countdown-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--ez-tooltip-title);
    min-width: 18px;
    text-align: center;
}

/* ============================================
   Icon Mode Styles
   ============================================ */
.ez-nudge-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--ez-primary);
    background: white;
    color: var(--ez-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ez-transition) ease;
    font-size: 18px;
}

.ez-nudge-icon-btn:hover {
    background: linear-gradient(135deg, var(--ez-primary) 0%, var(--ez-secondary) 100%);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

/* ============================================
   State Indicator (Debug Mode)
   Positioned at TOP, invisible background
   ============================================ */
.state-indicator {
    position: absolute;
    top: -20px;  /* Positioned at top of button */
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    
    /* Invisible background and border */
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* State-specific text colors only (no backgrounds) */
.state-indicator-init {
    color: #6366f1;
}

.state-indicator-count {
    color: #ef4444;
    animation: pulse-indicator-text 1s infinite;
}

.state-indicator-hover {
    color: #3b82f6;
}

.state-indicator-wait {
    color: #f59e0b;
}

.state-indicator-leave {
    color: #10b981;
}

@keyframes pulse-indicator-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   Cross-Browser Compatibility
   ============================================ */
.ez-tooltip * {
    box-sizing: border-box;
}

/* Prevent text selection in tooltip */
.ez-tooltip {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth transitions for all interactive elements */
.ez-tooltip button,
.ez-tooltip .ez-tooltip-cta {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    ez-nudge-button .ez-tooltip,
    ez-nudge-button .state-indicator {
        display: none !important;
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */
@media (prefers-contrast: high) {
    .ez-tooltip {
        border-width: 4px;
    }
    
    .ez-tooltip-cta {
        border: 2px solid currentColor;
    }
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    ez-nudge-button,
    .ez-tooltip,
    .ez-tooltip-cta,
    .ez-tooltip-title {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   END OF FILE
   ============================================ */