/**
 * Creator UX Enhancements - Modern Mobile-First Design
 * 5 Key Improvements for Better User Experience
 */

/* ============================================
   1. SMOOTH CARD ANIMATIONS
   Modern tap/hover effects for cards
   ============================================ */

.card, .perk-card, .campaign-card, .campaign-card-small {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

/* Desktop hover effects */
@media (min-width: 769px) {
    .card:hover, .perk-card:hover, .campaign-card:hover, .campaign-card-small:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile tap feedback */
@media (max-width: 768px) {
    .card:active, .perk-card:active, .campaign-card:active, .campaign-card-small:active {
        transform: scale(0.98);
        opacity: 0.9;
        transition: all 0.15s ease;
    }
}

/* Smooth card reveal animation on page load */
@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .perk-card, .campaign-card-small {
    animation: cardReveal 0.4s ease-out backwards;
}

/* Stagger animation for multiple cards */
.campaign-card-small:nth-child(1) { animation-delay: 0.05s; }
.campaign-card-small:nth-child(2) { animation-delay: 0.1s; }
.campaign-card-small:nth-child(3) { animation-delay: 0.15s; }
.campaign-card-small:nth-child(4) { animation-delay: 0.2s; }
.campaign-card-small:nth-child(5) { animation-delay: 0.25s; }

.perk-card:nth-child(1) { animation-delay: 0.05s; }
.perk-card:nth-child(2) { animation-delay: 0.1s; }
.perk-card:nth-child(3) { animation-delay: 0.15s; }


/* ============================================
   2. IMPROVED EMPTY STATES
   More engaging with better visuals
   ============================================ */

.empty-state {
    padding: var(--spacing-2xl) var(--spacing-lg);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}


/* ============================================
   3. SKELETON LOADING STATES
   Modern loading experience
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    background: linear-gradient(
        to right,
        var(--bg-elevated) 0%,
        var(--bg-hover) 20%,
        var(--bg-elevated) 40%,
        var(--bg-elevated) 100%
    );
    background-size: 800px 100px;
    animation: shimmer 2s infinite linear;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 200px;
    margin-bottom: var(--spacing-md);
}

.skeleton-line {
    height: 16px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}


/* ============================================
   4. TOAST NOTIFICATIONS
   Modern feedback system
   ============================================ */

#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

@media (max-width: 768px) {
    #toast-container {
        top: 60px;
        left: 20px;
        right: 20px;
    }
}

.toast {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    pointer-events: all;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--accent);
}

@media (max-width: 768px) {
    .toast {
        min-width: auto;
        width: 100%;
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

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

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}


/* ============================================
   5. ENHANCED BUTTON FEEDBACK
   Better tap/click feedback
   ============================================ */

.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-outline {
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple effect on click */
.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:active::before {
    width: 300px;
    height: 300px;
}

/* Enhanced hover states */
@media (min-width: 769px) {
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }
}

/* Mobile tap feedback */
@media (max-width: 768px) {
    .btn:active {
        transform: scale(0.96);
    }
}

/* Primary button enhancement */
.btn-primary {
    box-shadow: 0 2px 8px rgba(255, 92, 195, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(255, 92, 195, 0.4);
}

/* Disabled state */
.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover, .btn.disabled:hover {
    transform: none !important;
}


/* ============================================
   BONUS: SMOOTH PAGE TRANSITIONS
   ============================================ */

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

.page-container {
    animation: pageEnter 0.4s ease-out;
}


/* ============================================
   BONUS: IMPROVED FORM INPUTS
   ============================================ */

.form-input, .form-select, .form-textarea {
    transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* ============================================
   BONUS: BADGE ANIMATIONS
   ============================================ */

.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.badge-success, .badge-primary {
    animation: badgePulse 2s ease-in-out infinite;
}
