/**
 * Hello Middleton - Quick Actions Component
 * Horizontal pill-style action buttons with hover effects
 * Mobile-optimized with horizontal scroll
 *
 * @requires tokens.css
 * @since 2.1.4
 */

/* ==========================================================================
   QUICK ACTIONS CONTAINER
   ========================================================================== */

.hm-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    padding: var(--space-4) var(--space-2);
    background: var(--hm-bg-subtle);
    border-radius: var(--radius-lg);
    position: relative;
    animation: fadeInUp 0.5s var(--ease-out) 0.1s both;
}

/* Subtle top accent line */
.hm-quick-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--hm-primary), var(--hm-accent));
    border-radius: 0 0 3px 3px;
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.hm-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--hm-bg-elevated);
    border: 1px solid var(--hm-border);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hm-text);
    text-decoration: none !important;
    transition: all var(--duration-normal) var(--ease-out);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Subtle shine effect on hover */
.hm-action-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.4s ease;
}

.hm-action-btn:hover::after {
    left: 100%;
}

.hm-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--hm-text);
}

.hm-action-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ==========================================================================
   ACTION ICON
   ========================================================================== */

.hm-action-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform var(--duration-fast) var(--ease-out);
}

.hm-action-btn:hover .hm-action-icon {
    transform: scale(1.15);
}

/* ==========================================================================
   ACTION TEXT
   ========================================================================== */

.hm-action-text {
    white-space: nowrap;
}

/* ==========================================================================
   ACTION BUTTON COLOR VARIANTS
   ========================================================================== */

/* CSS custom property for each action type */
.hm-action-post { --action-color: #0F766E; }
.hm-action-ad { --action-color: #B45309; }
.hm-action-event { --action-color: #2563EB; }
.hm-action-biz { --action-color: #7C3AED; }
.hm-action-forum { --action-color: #059669; }
.hm-action-lost { --action-color: #EA580C; }
.hm-action-storm { --action-color: #475569; }
.hm-action-cams { --action-color: #DC2626; }
.hm-action-chat { --action-color: #DB2777; }
.hm-action-join { --action-color: #059669; }

/* Hover states with semantic colors */
.hm-action-post:hover {
    border-color: #0F766E;
    background: #ECFDF5;
    color: #0F766E !important;
}

.hm-action-ad:hover {
    border-color: #B45309;
    background: #FEF3C7;
    color: #92400E !important;
}

.hm-action-event:hover {
    border-color: #2563EB;
    background: #DBEAFE;
    color: #1D4ED8 !important;
}

.hm-action-biz:hover {
    border-color: #7C3AED;
    background: #EDE9FE;
    color: #6D28D9 !important;
}

.hm-action-forum:hover {
    border-color: #059669;
    background: #D1FAE5;
    color: #047857 !important;
}

.hm-action-lost:hover {
    border-color: #EA580C;
    background: #FED7AA;
    color: #C2410C !important;
}

.hm-action-storm:hover {
    border-color: #475569;
    background: #E2E8F0;
    color: #334155 !important;
}

.hm-action-cams:hover {
    border-color: #DC2626;
    background: #FEE2E2;
    color: #B91C1C !important;
}

.hm-action-chat:hover {
    border-color: #DB2777;
    background: #FCE7F3;
    color: #9D174D !important;
}

.hm-action-join:hover {
    border-color: #059669;
    background: #D1FAE5;
    color: #047857 !important;
}

/* ==========================================================================
   ANIMATION
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .hm-quick-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: var(--space-3);
        gap: var(--space-2);
        border-radius: var(--radius-xl);
        /* Smooth scroll snapping */
        scroll-snap-type: x proximity;
        scroll-behavior: smooth;
        /* Padding for edge content visibility */
        scroll-padding: 0 var(--space-4);
        /* Fade edges to hint at scrollability */
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 16px,
            black calc(100% - 16px),
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 16px,
            black calc(100% - 16px),
            transparent 100%
        );
    }

    .hm-quick-actions::-webkit-scrollbar {
        display: none;
    }

    /* Hide the top accent on mobile for cleaner look */
    .hm-quick-actions::before {
        display: none;
    }

    .hm-action-btn {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.8rem;
        min-height: 44px;
        scroll-snap-align: start;
        /* Slightly smaller radius for compact look */
        border-radius: 22px;
    }

    .hm-action-icon {
        font-size: 1rem;
    }

    /* Disable hover lift on touch devices */
    .hm-action-btn:hover {
        transform: none;
    }

    .hm-action-btn:active {
        transform: scale(0.96);
        opacity: 0.9;
    }
}

/* ==========================================================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .hm-quick-actions {
        margin: 0 -12px;
        border-radius: var(--radius-lg);
        padding: 12px 16px;
        background: var(--hm-bg-elevated);
        border: 1px solid var(--hm-border);
        /* Adjust mask for edge padding */
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 12px,
            black calc(100% - 12px),
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 12px,
            black calc(100% - 12px),
            transparent 100%
        );
    }

    .hm-action-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
        border-radius: 20px;
    }

    .hm-action-icon {
        font-size: 0.95rem;
    }

    .hm-action-text {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .hm-quick-actions {
        animation: none;
    }

    .hm-action-btn,
    .hm-action-btn::after,
    .hm-action-icon {
        transition: none !important;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .hm-quick-actions {
        display: none;
    }
}
