/* ============================================
   AI Poll Creator - Custom Styles
   ============================================ */

:root {
    --primary: #00AF91;
    --primary-dark: #007E68;
    --secondary: #00cec9;
    --accent: #1F2D3F;
    --dark: #1F2D3F;
    --light-bg: #f5f8f7;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ad gutters (blank space left/right) */
.ad-gutter {
    min-height: 100%;
    background: transparent;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    box-shadow: 0 2px 10px rgba(0, 175, 145, 0.3);
    padding: 0.8rem 0;
}

.navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    color: var(--secondary);
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    margin: 0 2px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #007E68 0%, #00AF91 50%, #00cec9 100%);
    color: #fff;
    padding: 4rem 0 3rem;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-weight: 800;
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-3px);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
}

/* Poll Card */
.poll-card {
    border-left: 4px solid var(--primary);
    margin-bottom: 1.5rem;
}

.poll-card .card-body {
    padding: 1.5rem;
}

.poll-card .card-body {
    padding: 1.5rem;
}

.poll-card .poll-question {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.8rem;
}

.poll-card .poll-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.poll-card .poll-meta span {
    font-size: 0.85rem;
    color: #636e72;
}

.poll-card .poll-meta i {
    margin-right: 4px;
    color: var(--primary);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-technology { background: #dfe6e9; color: #2d3436; }
.cat-sports { background: #ffeaa7; color: #636e72; }
.cat-politics { background: #fab1a0; color: #d63031; }
.cat-education { background: #81ecec; color: #00b894; }
.cat-entertainment { background: #b8f0e8; color: #007E68; }
.cat-other { background: #b2bec3; color: #2d3436; }

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 175, 145, 0.4);
}

.btn-success {
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Vote Option */
.vote-option {
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.vote-option:hover {
    border-color: var(--primary);
    background: rgba(0, 175, 145, 0.05);
}

.vote-option.selected {
    border-color: var(--primary);
    background: rgba(0, 175, 145, 0.1);
}

.vote-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: var(--primary);
}

.vote-option label {
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
    flex: 1;
}

/* Results */
.result-option {
    margin-bottom: 1.2rem;
}

.result-option .option-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.result-option .option-text {
    font-weight: 600;
}

.result-option .option-votes {
    color: #636e72;
    font-size: 0.9rem;
}

.result-option .progress {
    height: 28px;
    border-radius: 14px;
    background: #dfe6e9;
    overflow: hidden;
}

.result-option .progress-bar {
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 28px;
    transition: width 1s ease;
}


/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    border: 2px solid #dfe6e9;
    transition: border-color 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 175, 145, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

/* Option Row */
.option-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.option-row .form-control {
    flex: 1;
}

.option-row .btn-remove {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dfe6e9;
    background: #fff;
    color: #d63031;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.option-row .btn-remove:hover {
    background: #d63031;
    color: #fff;
    border-color: #d63031;
}

/* Auth Pages */
.auth-container {
    max-width: 460px;
    margin: 3rem auto;
}

.auth-container .card {
    padding: 2rem;
}

.auth-container h2 {
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* Payment Page */
.payment-card {
    max-width: 500px;
    margin: 3rem auto;
    text-align: center;
}

.payment-card .price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
}

.payment-card .price-sub {
    color: #636e72;
    font-size: 0.95rem;
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-filter .btn {
    border-radius: 20px;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.category-filter .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Poll Card Wrap: positioning parent that lets the badge protrude ── */
.poll-card-wrap {
    position: relative;
    padding-top: 14px;   /* headroom for the protruding badge */
}

/* ── Countdown Timer: highlighted tag that sticks out above the card ── */
.poll-countdown {
    position: absolute;
    top: 0;
    left: 16px;
    background: linear-gradient(135deg, #0984e3, #00b4d8);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px 4px 9px;
    border-radius: 20px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.4px;
    box-shadow: 0 3px 12px rgba(9, 132, 227, 0.45);
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}
.poll-countdown.ended {
    background: linear-gradient(135deg, #e17055, #d63031);
    box-shadow: 0 3px 12px rgba(214, 48, 49, 0.45);
}
@keyframes cdHourglass {
    0%, 100% { transform: rotate(0deg); }
    50%       { transform: rotate(-20deg); }
}
.poll-countdown i {
    font-size: 0.65rem;
    animation: cdHourglass 2.5s ease-in-out infinite;
}
.poll-countdown.ended i {
    animation: none;
}

/* Trending Badge */
.trending-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #e17055, #d63031);
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

@keyframes hotIconPulse {
    0%   { transform: scale(1); filter: brightness(1); text-shadow: none; }
    50%  { transform: scale(1.15); filter: brightness(1.2); text-shadow: 0 0 14px rgba(214,48,49,.35); }
    100% { transform: scale(1); filter: brightness(1); text-shadow: none; }
}

.trending-badge i {
    display: inline-block;
    animation: hotIconPulse 1.25s infinite ease-in-out;
    transform-origin: center;
}

/* Extra: pulse the badge background subtly too */
.trending-badge {
    animation: hotBadgeBreath 1.25s infinite ease-in-out;
    transform-origin: center;
}
@keyframes hotBadgeBreath {
    0% { transform: translateZ(0) scale(1); }
    50% { transform: translateZ(0) scale(1.04); }
    100% { transform: translateZ(0) scale(1); }
}

/* Infinite trending carousel */
.trending-carousel {
    overflow: hidden;
    position: relative;
    padding: .25rem .25rem;
}
.trending-carousel-track {
    display: flex;
    gap: 1rem;
    width: max-content;
    animation: trendingMarquee 22s linear infinite;
}
@keyframes trendingMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.trending-carousel:hover .trending-carousel-track {
    animation-play-state: paused;
}
.trending-carousel-item {
    flex: 0 0 280px;
}
@media (max-width: 991px) {
    .trending-carousel-item { flex-basis: 260px; }
}
@media (max-width: 576px) {
    .trending-carousel-item { flex-basis: 230px; }
}

@media (prefers-reduced-motion: reduce) {
    .trending-badge i,
    .trending-carousel-track {
        animation: none !important;
    }
}

/* Footer */
.site-footer {
    background: #1F2D3F;
    color: #b2bec3;
    padding: 2rem 0;
    margin-top: auto;
}

.site-footer .footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: var(--secondary);
    text-decoration: none;
}

/* Flash Messages */
.flash-message {
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Poll card with image on left */
.poll-with-image {
    display: flex;
    gap: 1rem;
}

.poll-with-image-thumb {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #dfe6e9;
}

.poll-with-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poll-with-image-content {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 2.5rem 0 2rem;
    }

    .stat-card .stat-number {
        font-size: 1.8rem;
    }

    .option-row {
        flex-wrap: nowrap;
    }
}

@media (max-width: 576px) {
    .poll-card .poll-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .category-filter {
        justify-content: center;
    }
}
