/* ============================================
   Freebie Mom Sweepstakes Database - Frontend
   ============================================ */

/* Page Container */
.fmsdb-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Hero Banner
   ============================================ */
.fmsdb-hero {
    background: linear-gradient(135deg, #e91e8c 0%, #9c27b0 50%, #3f51b5 100%);
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
    margin: 24px 0 20px;
    position: relative;
    overflow: hidden;
}

.fmsdb-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: fmsdb-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

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

.fmsdb-hero-content { position: relative; z-index: 1; }

.fmsdb-hero-title {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #fff !important;
    margin: 0 0 12px !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
    line-height: 1.2 !important;
}

.fmsdb-hero-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin: 0 0 24px;
}

/* Search Bar */
.fmsdb-search-wrap {
    max-width: 600px;
    margin: 0 auto;
}

.fmsdb-search-form {
    display: flex;
    gap: 0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.fmsdb-search-input {
    flex: 1;
    padding: 16px 24px !important;
    border: none !important;
    font-size: 16px !important;
    outline: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #333 !important;
    min-width: 0;
}

.fmsdb-search-btn {
    padding: 16px 28px;
    background: linear-gradient(135deg, #ff6b9d, #e91e8c);
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.fmsdb-search-btn:hover {
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
}

/* ============================================
   Stats Strip
   ============================================ */
.fmsdb-stats-strip {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fmsdb-strip-stat {
    flex: 1;
    min-width: 100px;
    background: #fff;
    border: 1px solid #f0e6ff;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(233,30,140,0.08);
}

.fmsdb-strip-num {
    display: block;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fmsdb-strip-label {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ============================================
   Ad Containers
   ============================================ */
.fmsdb-ad {
    margin: 20px 0;
    text-align: center;
    min-height: 90px;
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
}

.fmsdb-grid-ad {
    grid-column: 1 / -1;
    margin: 8px 0;
    text-align: center;
    min-height: 90px;
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
}

/* ============================================
   Filter Bar
   ============================================ */
.fmsdb-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fmsdb-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fmsdb-cat-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    background: #f5f5f5;
    color: #555 !important;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.fmsdb-cat-btn:hover,
.fmsdb-cat-btn.active {
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}

.fmsdb-sort-select {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
}

/* ============================================
   Results Meta
   ============================================ */
.fmsdb-results-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
}

.fmsdb-results-meta p { margin: 0; }

/* ============================================
   Sweepstakes Grid
   ============================================ */
.fmsdb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
    align-items: start;
}

@media (max-width: 1100px) {
    .fmsdb-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .fmsdb-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .fmsdb-hero { padding: 32px 16px; }
    .fmsdb-hero-title { font-size: 26px !important; }
    .fmsdb-hero-subtitle { font-size: 15px; }
    .fmsdb-filter-bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .fmsdb-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Sweepstakes Card
   ============================================ */
.fmsdb-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(233,30,140,0.08);
}

.fmsdb-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(233,30,140,0.15);
}

.fmsdb-card.fmsdb-card-ending {
    border-color: rgba(233,30,140,0.3);
}

/* Status Badge (top-left) */
.fmsdb-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.fmsdb-badge-new {
    background: rgba(233,30,140,0.9);
    color: #fff;
}

.fmsdb-badge-ending {
    background: rgba(244,67,54,0.9);
    color: #fff;
    animation: fmsdb-blink 1.5s ease-in-out infinite;
}

@keyframes fmsdb-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Category chip (top-right on image) */
.fmsdb-card-cat {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.fmsdb-cat-sweepstakes { background: rgba(156,39,176,0.85); }
.fmsdb-cat-instant_win { background: rgba(255,152,0,0.9); }
.fmsdb-cat-freebie     { background: rgba(76,175,80,0.9); }
.fmsdb-cat-cash        { background: rgba(33,150,243,0.9); }
.fmsdb-cat-product     { background: rgba(96,125,139,0.9); }

/* Card Image */
.fmsdb-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #f3e5f5, #fce4ec);
    flex-shrink: 0;
    position: relative;
}

.fmsdb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.fmsdb-card:hover .fmsdb-card-image img {
    transform: scale(1.05);
}

.fmsdb-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f0ff, #fce4ec);
    gap: 6px;
}
.fmsdb-fallback-logo {
    width: 50px;
    max-width: 35%;
    opacity: 0.75;
    object-fit: contain;
}
.fmsdb-gift-bounce {
    font-size: 48px;
    display: block;
    animation: fmsdb-gift-bounce 1.3s ease-in-out infinite;
}
@keyframes fmsdb-gift-bounce {
    0%, 100% { transform: translateY(0); }
    45%       { transform: translateY(-10px); }
    65%       { transform: translateY(-6px); }
}

/* Card Body */
.fmsdb-card-body {
    padding: 14px 14px 10px;
    flex: 1;
}

.fmsdb-card-brand {
    font-size: 10px;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
    font-weight: 700;
}

.fmsdb-card-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 0 8px !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fmsdb-card-prize {
    font-size: 12px;
    color: #444;
    margin-bottom: 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fmsdb-prize-value {
    color: #27ae60;
    font-weight: 700;
}

.fmsdb-countdown {
    font-size: 11px;
    margin-top: 4px;
}

.fmsdb-countdown-urgent { color: #e74c3c; font-weight: 700; }
.fmsdb-countdown-normal { color: #aaa; }

/* Card Footer */
.fmsdb-card-footer {
    padding: 0 14px 14px;
}

.fmsdb-enter-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
    color: #fff !important;
    text-align: center;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(233,30,140,0.25);
    box-sizing: border-box;
}

.fmsdb-enter-btn:hover {
    background: linear-gradient(135deg, #c2185b, #7b1fa2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233,30,140,0.4);
    color: #fff !important;
}

/* ============================================
   Pagination
   ============================================ */
.fmsdb-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 32px 0;
}

.fmsdb-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 50px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    background: #fff;
    color: #555 !important;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.fmsdb-page-btn.active,
.fmsdb-page-btn:hover {
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}

/* ============================================
   Empty State
   ============================================ */
.fmsdb-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    border: 2px dashed #e0e0e0;
    margin: 20px 0;
}

.fmsdb-empty-icon { font-size: 64px; }

.fmsdb-empty h3 {
    font-size: 22px;
    color: #555;
    margin: 16px 0 8px;
}

.fmsdb-empty p { color: #888; }

/* ============================================
   Disclaimer
   ============================================ */
.fmsdb-disclaimer {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 32px;
    border-left: 4px solid #e91e8c;
}

.fmsdb-disclaimer p {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

/* Void States */
.fmsdb-void-states {
    font-size: 0.72rem;
    color: #888;
    margin-top: 6px;
    padding: 4px 8px;
    background: #f8f8f8;
    border-radius: 4px;
    border-left: 3px solid #e74c3c;
    line-height: 1.3;
}

/* Entry Frequency Badge */
.fmsdb-entry-freq {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 6px;
    background: #e8f4fd;
    color: #1a6fa8;
    border: 1px solid #b3d9f5;
}
.fmsdb-freq-daily    { background: #e8f8f0; color: #1a7a45; border-color: #a8e0c0; }
.fmsdb-freq-weekly   { background: #f0e8ff; color: #6a1ab8; border-color: #c8a8f0; }
.fmsdb-freq-monthly  { background: #fff8e8; color: #a86a1a; border-color: #f0d8a8; }
.fmsdb-freq-one-time { background: #f8e8e8; color: #a81a1a; border-color: #f0a8a8; }
.fmsdb-freq-unlimited{ background: #e8fff8; color: #1a8a6a; border-color: #a8f0d8; }

/* Entry Frequency Badge */
.fmsdb-entry-freq {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 6px;
    background: #e8f4fd;
    color: #1a6fa8;
    border: 1px solid #b3d9f5;
}
.fmsdb-freq-daily     { background: #e8f8f0; color: #1a7a45; border-color: #a8e0c0; }
.fmsdb-freq-weekly    { background: #f0e8ff; color: #6a1ab8; border-color: #c8a8f0; }
.fmsdb-freq-monthly   { background: #fff8e8; color: #a86a1a; border-color: #f0d8a8; }
.fmsdb-freq-one-time  { background: #f8e8e8; color: #a81a1a; border-color: #f0a8a8; }
.fmsdb-freq-unlimited { background: #e8fff8; color: #1a8a6a; border-color: #a8f0d8; }


/* Override card-image img for fallback logos */
.fmsdb-card-image .fmsdb-no-image .fmsdb-fallback-logo {
    width: 50px !important;
    height: auto !important;
    max-width: 35% !important;
    object-fit: contain !important;
}

.fmsdb-card-image .fmsdb-no-image .fmsdb-gift-bounce {
    font-size: 48px !important;
    margin-top: 8px !important;
}

/* Entry Frequency Badges */
.fmsdb-freq-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.fmsdb-freq-daily { background: #e8f5e9; color: #2e7d32; }
.fmsdb-freq-one-time { background: #fff3e0; color: #e65100; }
.fmsdb-freq-weekly { background: #e3f2fd; color: #1565c0; }
.fmsdb-freq-monthly { background: #f3e5f5; color: #7b1fa2; }
.fmsdb-freq-misc { background: #f5f5f5; color: #616161; }
