/* ============================================================
   🎨 OPPORTUNITY CARDS - PREMIUM CREATIVE DESIGN
   مصممة للتعبير عن الإبداع والسرعة والتكاتف
   ============================================================ */

/* ---------- Base Card Structure ---------- */
.opportunity-card {
    position: relative;
    background: linear-gradient(145deg,
            rgba(30, 41, 59, 0.9) 0%,
            rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Holographic shimmer overlay */
.opportunity-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.03) 45%,
            rgba(255, 255, 255, 0.06) 50%,
            rgba(255, 255, 255, 0.03) 55%,
            transparent 60%);
    background-size: 200% 100%;
    animation: shimmer 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 200% 0;
    }

    50% {
        background-position: -200% 0;
    }
}

/* Card hover effects */
.opportunity-card:hover {
    transform: translateY(-12px) rotateX(2deg);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(245, 158, 11, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ---------- Urgent Card (Featured) ---------- */
.opportunity-card.urgent {
    position: relative;
    border: 2px solid transparent;
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-image:
        linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98)),
        linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
    animation: urgentGlow 3s ease-in-out infinite;
    z-index: 1;
    /* Ensure base stacking context */
}

/* Fix for overlay issue on urgent cards */
/* Featured badge on urgent cards */
.opportunity-card.urgent::before {
    content: '🔥 عاجل';
    position: absolute;
    top: 15px;
    left: 15px;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    inset: auto !important;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 25 !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* Ensure content sits above any backgrounds */
.opportunity-card .card-header,
.opportunity-card .card-body {
    position: relative;
    z-index: 20;
}

@keyframes urgentGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
    }
}

/* Featured badge (replacing ::before) */
.opportunity-card.urgent .featured-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 0.5rem 1.5rem 0.5rem 2rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.featured-badge i {
    animation: starPulse 1.5s ease-in-out infinite;
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ---------- Card Header ---------- */
.opportunity-card .card-header {
    position: relative;
    padding: 1.75rem 1.75rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

/* Category pill */
.opportunity-card .card-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.opportunity-card:hover .card-category {
    transform: translateX(-5px);
}

/* Title with gradient */
.opportunity-card .card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.opportunity-card .card-description {
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Card Body ---------- */
.opportunity-card .card-body {
    padding: 1.5rem 1.75rem 1.75rem;
    position: relative;
    z-index: 2;
}

/* Meta info row */
.opportunity-card .card-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.opportunity-card .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.opportunity-card .meta-item.budget {
    font-size: 1.2rem;
    font-weight: 900;
    color: #10b981;
}

.opportunity-card .meta-item.budget i {
    color: #f59e0b;
    animation: coinBounce 2s ease-in-out infinite;
}

@keyframes coinBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.meta-divider {
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* ---------- COUNTDOWN TIMER - Dynamic & Creative ---------- */
.countdown-container {
    position: relative;
    background: linear-gradient(145deg,
            rgba(15, 23, 42, 0.8) 0%,
            rgba(30, 41, 59, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

/* Animated background particles */
.countdown-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(245, 158, 11, 0.1),
            transparent);
    animation: countdownWave 3s linear infinite;
}

@keyframes countdownWave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

.countdown-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.countdown-label i {
    color: #f59e0b;
    font-size: 0.75rem;
}

/* Main countdown display */
.countdown-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
}

.countdown-value {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
    line-height: 1;
    transition: all 0.3s ease;
}

.countdown-value.tick {
    animation: tickPulse 0.3s ease;
}

@keyframes tickPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.countdown-unit-label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.countdown-separator {
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(245, 158, 11, 0.5);
    animation: separatorBlink 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes separatorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Urgency indicator ring */
.urgency-ring {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
}

.urgency-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.urgency-ring circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.urgency-ring .ring-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.urgency-ring .ring-progress {
    stroke: url(#urgencyGradient);
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

/* Expired state */
.countdown-expired {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
}

.countdown-expired span {
    font-weight: 800;
    color: #ef4444;
    font-size: 1.1rem;
}

/* ---------- Activity Indicators ---------- */
.card-activity {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.activity-pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: activityPulse 2s ease-in-out infinite;
}

@keyframes activityPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
        transform: scale(1.1);
    }
}

.activity-text {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 600;
}

.activity-avatars {
    display: flex;
    margin-right: auto;
}

.activity-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #0f172a;
    margin-right: -8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    font-weight: 700;
}

/* ---------- CTA Button ---------- */
.opportunity-card .card-btn-primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
}

.opportunity-card .card-btn-primary::before {
    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.5s ease;
}

.opportunity-card .card-btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.opportunity-card .card-btn-primary:hover::before {
    left: 100%;
}

/* Urgent card button */
.opportunity-card.urgent .card-btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.opportunity-card.urgent .card-btn-primary:hover {
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.4);
}

/* ---------- Speed & Creativity Indicators ---------- */
.speed-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent,
            #10b981 20%,
            #f59e0b 50%,
            #ef4444 80%,
            transparent);
    background-size: 200% 100%;
    animation: speedFlow 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.opportunity-card:hover .speed-indicator {
    opacity: 1;
}

@keyframes speedFlow {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Collaboration indicator */
.collab-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #818cf8;
    font-weight: 600;
}

.collab-indicator i {
    font-size: 0.85rem;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 640px) {
    .opportunity-card {
        border-radius: 20px;
    }

    .opportunity-card .card-header {
        padding: 1.5rem 1.25rem 1rem;
    }

    .opportunity-card .card-body {
        padding: 1.25rem;
    }

    .countdown-value {
        font-size: 1.5rem;
    }

    .countdown-unit {
        min-width: 45px;
    }

    .card-meta {
        gap: 1rem;
    }
}

/* ---------- Dark/Light Adaptation ---------- */
@media (prefers-color-scheme: light) {
    .opportunity-card {
        background: linear-gradient(145deg,
                rgba(255, 255, 255, 0.95) 0%,
                rgba(241, 245, 249, 0.98) 100%);
        border-color: rgba(0, 0, 0, 0.08);
    }

    .opportunity-card .card-title {
        background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .opportunity-card .card-description {
        color: rgba(71, 85, 105, 0.8);
    }
}