/**
 * Post Promotions CSS Styling
 *
 * Styles for promoted posts, badges, and campaign dashboards.
 * Include this in your main CSS file or link separately:
 * <link rel="stylesheet" href="/css/post_promotions.css">
 *
 * ✅ NEW FILE - Separate from product promotion styles
 */

/* ==========================================
   Promoted Post Badge
   ========================================== */

.promoted-post {
    position: relative;
    border: 2px solid #e0e7ff !important;
    background: linear-gradient(to bottom, #faf5ff 0%, #ffffff 100%);
    max-width: 100%;
    box-sizing: border-box;
}

.promoted-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.promoted-icon {
    font-size: 14px;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Alternative badge styles (comment/uncomment as preferred) */

/* Minimal style */
.promoted-badge.minimal {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

/* Outlined style */
.promoted-badge.outlined {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

/* ==========================================
   Promoted Post Card Enhancements
   ========================================== */

.promoted-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
}

.promoted-post:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* ==========================================
   CTA Button for Promoted Posts
   ========================================== */

.promoted-cta-container {
    margin: 16px 0;
    padding: 0;
}

.promoted-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    border: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.promoted-cta-button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: white !important;
}

.promoted-cta-button:active {
    transform: translateY(0);
}

/* ==========================================
   Campaign Dashboard Styles
   ========================================== */

.campaign-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.campaign-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.campaign-status.active {
    background: #d1fae5;
    color: #065f46;
}

.campaign-status.paused {
    background: #fef3c7;
    color: #92400e;
}

.campaign-status.completed {
    background: #e5e7eb;
    color: #374151;
}

.campaign-status.pending {
    background: #dbeafe;
    color: #1e40af;
}

.budget-progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.budget-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    position: relative;
}

.budget-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    display: block;
}

/* ==========================================
   Promotion Modal
   ========================================== */

.promotion-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.promotion-modal.active {
    display: flex;
}

.promotion-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.promotion-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.promotion-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.promotion-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.promotion-modal-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.budget-type-selector {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.budget-type-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.budget-type-option:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.budget-type-option input[type="radio"] {
    margin-right: 12px;
}

.budget-type-option.selected {
    border-color: #667eea;
    background: #f5f7ff;
}

.estimate-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.estimate-box h4 {
    color: #065f46;
    margin-bottom: 8px;
}

.estimate-box p {
    color: #047857;
    font-size: 14px;
    margin: 4px 0;
}

/* ==========================================
   Creator Earnings Dashboard
   ========================================== */

.earnings-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.earnings-amount {
    font-size: 48px;
    font-weight: 700;
    margin: 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.earnings-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.earnings-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.breakdown-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.breakdown-value {
    font-size: 20px;
    font-weight: 600;
    display: block;
}

.breakdown-label {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
    display: block;
}

/* ==========================================
   Buttons
   ========================================== */

.btn-promote {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-promote:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-promote:active {
    transform: translateY(0);
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .promoted-badge {
        font-size: 10px;
        padding: 3px 8px;
        top: 8px;
        right: 8px;
    }

    .campaign-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .promotion-modal-content {
        padding: 20px;
    }

    .earnings-amount {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .campaign-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* ==========================================
   Loading & Skeleton States
   ========================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* ==========================================
   Compact Promoted Posts (Reddit-style)
   ========================================== */

.compact-promoted-post {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-left: 2px solid #667eea;
    border-radius: 6px;
    padding: 12px;
    position: relative;
}

.compact-ad-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.compact-promoted-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.compact-ad-body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.compact-ad-text {
    flex: 1;
    min-width: 0; /* Allows text to shrink */
}

.compact-ad-preview {
    font-size: 13px;
    line-height: 1.4;
    color: #4b5563;
}

.compact-ad-thumbnail {
    flex-shrink: 0;
    position: relative;
    width: 50px;
    height: 50px;
}

.compact-ad-thumbnail img,
.compact-ad-thumbnail video {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.compact-ad-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.compact-cta-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.compact-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.compact-expand-button {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compact-expand-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.compact-ad-full-content {
    margin-top: 16px;
}

/* Keep inline layout on all screen sizes */
@media (max-width: 600px) {
    .compact-ad-body {
        gap: 8px;
    }

    .compact-ad-preview {
        font-size: 13px;
    }

    .compact-cta-button,
    .compact-expand-button {
        font-size: 11px;
        padding: 6px 12px;
    }
}