/**
 * Featured Project Tiers - Visual Differentiation
 * Sprint 3 - Phase 4: Visual Hierarchy Implementation
 * Author: FEDEV
 * Date: 2026-01-08
 *
 * Implements SYSARCH's approved visual hierarchy:
 * - FREE: Bronze badge (standard size)
 * - BRONZE: Silver badge (standard size)
 * - SILVER: Gold badge (5% larger card)
 * - GOLD: Diamond badge (10% larger card + animations)
 */

/* ================================================================
   BASE FEATURED CARD STYLES
   ================================================================ */

.project-card.is-featured {
    position: relative;
    transition: all 0.3s ease;
}

/* Featured badge base positioning */
.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    display: inline-block;
}

/* ================================================================
   FREE TIER - BRONZE BADGE (🥉)
   Standard size, bronze color scheme
   ================================================================ */

.project-card.featured-free {
    border: 2px solid #CD7F32;
    background: linear-gradient(to bottom, #fff, #f8f8f8);
}

.project-card.featured-free .featured-badge {
    background: #CD7F32;
    color: white;
}

.project-card.featured-free .featured-badge::before {
    content: "🥉 FEATURED";
}

.project-card.featured-free:hover {
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.2);
}

/* ================================================================
   BRONZE TIER - SILVER BADGE (🥈)
   Standard size, silver color scheme
   ================================================================ */

.project-card.featured-bronze {
    border: 2px solid #C0C0C0;
    background: linear-gradient(to bottom, #fff, #f5f5f5);
}

.project-card.featured-bronze .featured-badge {
    background: linear-gradient(135deg, #C0C0C0, #E8E8E8);
    color: #333;
}

.project-card.featured-bronze .featured-badge::before {
    content: "🥈 FEATURED";
}

.project-card.featured-bronze:hover {
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.25);
}

/* ================================================================
   SILVER TIER - GOLD BADGE (🥇)
   5% larger card, gold color scheme, enhanced hover
   ================================================================ */

.project-card.featured-silver {
    border: 3px solid #FFD700;
    background: linear-gradient(to bottom, #FFFDF0, #FFF8DC);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    z-index: 2;
}

.project-card.featured-silver .featured-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 700;
}

.project-card.featured-silver .featured-badge::before {
    content: "🥇 FEATURED PRO";
}

.project-card.featured-silver:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.4);
}

/* ================================================================
   GOLD TIER - DIAMOND BADGE (💎)
   10% larger card, diamond blue scheme, premium animations
   ================================================================ */

.project-card.featured-gold {
    border: 4px solid #B9F2FF;
    background: linear-gradient(135deg, #FFFFFF, #F0F8FF);
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(185, 242, 255, 0.5);
    z-index: 3;
    position: relative;
}

/* Premium ribbon on top-right corner */
.project-card.featured-gold::before {
    content: "💎 PREMIUM";
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #B9F2FF, #00BFFF);
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    z-index: 10;
}

/* Diamond badge with shimmer animation */
.project-card.featured-gold .featured-badge {
    background: linear-gradient(135deg, #B9F2FF, #00BFFF, #1E90FF);
    background-size: 200% 200%;
    color: #000;
    font-weight: 800;
    animation: shimmer 3s infinite;
}

.project-card.featured-gold .featured-badge::before {
    content: "💎 PREMIUM FEATURED";
}

.project-card.featured-gold:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 30px rgba(185, 242, 255, 0.6);
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

/* Pulse animation for Gold tier ribbon */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Shimmer animation for Gold tier badge */
@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ================================================================
   PREMIUM FEATURED SECTION (GOLD ONLY - HOMEPAGE)
   ================================================================ */

.premium-featured-section {
    padding: 60px 5%;
    background: linear-gradient(135deg, #F0F8FF 0%, #FFFFFF 100%);
    border-top: 3px solid #B9F2FF;
    border-bottom: 3px solid #B9F2FF;
    margin: 40px 0;
}

.premium-featured-section .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1A1A1A;
    text-align: center;
    margin-bottom: 1rem;
}

.premium-featured-section .section-title::before {
    content: "💎 ";
}

.premium-featured-section .subtitle {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #666;
    margin-top: 0.5rem;
}

.premium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Premium grid cards are always Gold tier */
.premium-grid .project-card {
    /* Will inherit featured-gold styles */
}

/* ================================================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ================================================================ */

@media (max-width: 768px) {
    /* Reduce card scaling on mobile for better fit */
    .project-card.featured-silver {
        transform: scale(1.02);
    }

    .project-card.featured-gold {
        transform: scale(1.03);
    }

    .project-card.featured-silver:hover {
        transform: scale(1.03);
    }

    .project-card.featured-gold:hover {
        transform: scale(1.04);
    }

    /* Adjust premium ribbon size on mobile */
    .project-card.featured-gold::before {
        font-size: 10px;
        padding: 3px 8px;
        top: -10px;
        right: 10px;
    }

    /* Smaller badge text on mobile */
    .featured-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* Reduce animation intensity on mobile (performance) */
    .project-card.featured-gold .featured-badge {
        animation: shimmer 5s infinite; /* Slower animation */
    }

    .project-card.featured-gold::before {
        animation: pulse 3s infinite; /* Slower pulse */
    }

    /* Premium section mobile adjustments */
    .premium-featured-section {
        padding: 40px 3%;
    }

    .premium-featured-section .section-title {
        font-size: 1.5rem;
    }

    .premium-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Further reduce scaling on very small screens */
    .project-card.featured-silver {
        transform: scale(1.01);
    }

    .project-card.featured-gold {
        transform: scale(1.02);
    }

    /* Disable hover scaling on small touch devices */
    .project-card.featured-silver:hover,
    .project-card.featured-gold:hover {
        transform: scale(1.01);
    }
}

/* ================================================================
   GRID LAYOUT COMPENSATION
   When using CSS Grid or Flexbox, scaled cards can cause layout issues
   ================================================================ */

/* If project cards are in a grid, add margin to compensate for scaling */
.projects-grid .project-card.featured-silver,
.projects-grid .project-card.featured-gold {
    margin: 0.5rem;
}

/* Alternative: Use transform-origin to scale from center */
.project-card.featured-silver,
.project-card.featured-gold {
    transform-origin: center center;
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

/* Ensure badge text is readable */
.featured-badge {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .project-card.featured-free {
        border-width: 3px;
    }

    .project-card.featured-bronze {
        border-width: 3px;
    }

    .project-card.featured-silver {
        border-width: 4px;
    }

    .project-card.featured-gold {
        border-width: 5px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .project-card.featured-silver,
    .project-card.featured-gold {
        transition: none;
    }

    .project-card.featured-gold::before,
    .project-card.featured-gold .featured-badge {
        animation: none;
    }
}

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

@media print {
    /* Simplify for printing */
    .project-card.featured-silver,
    .project-card.featured-gold {
        transform: none;
        box-shadow: none;
    }

    .project-card.featured-gold::before {
        display: none; /* Hide animated ribbon in print */
    }

    /* Keep badges visible but remove animations */
    .featured-badge {
        background: #333 !important;
        color: white !important;
        animation: none;
    }
}

/* ================================================================
   ADDITIONAL VISUAL ENHANCEMENTS
   ================================================================ */

/* Subtle glow effect on Gold tier */
.project-card.featured-gold::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(185, 242, 255, 0.2);
}

/* Enhanced focus state for keyboard navigation */
.project-card.featured-free:focus,
.project-card.featured-bronze:focus,
.project-card.featured-silver:focus,
.project-card.featured-gold:focus {
    outline: 3px solid #E60026;
    outline-offset: 3px;
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .project-card.featured-free,
    .project-card.featured-bronze {
        background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
    }

    .project-card.featured-silver {
        background: linear-gradient(to bottom, #3a3a2a, #2a2a1a);
    }

    .project-card.featured-gold {
        background: linear-gradient(135deg, #2a2a3a, #1a1a2a);
    }

    .premium-featured-section {
        background: linear-gradient(135deg, #1a1a2a 0%, #0a0a1a 100%);
    }
}
