/* ============================================================
   PollsMaster — Dashboard v3 (Full Premium Revamp)
   ============================================================ */

/* ============================================================
   HERO HEADER
   ============================================================ */
.dash-header {
    background: linear-gradient(150deg, #060412 0%, #0c0822 40%, #060412 100%);
    padding: 3.75rem 0 6.5rem;
    position: relative;
    overflow: hidden;
}

/* Glowing orbs */
.dash-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 8%  50%, rgba(99,102,241,.42) 0%, transparent 52%),
        radial-gradient(ellipse at 88% 18%, rgba(6,182,212,.22)  0%, transparent 48%),
        radial-gradient(ellipse at 52% 88%, rgba(139,92,246,.2)  0%, transparent 45%);
    pointer-events: none;
}

/* Fine dot grid */
.dash-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.dash-header .container { position: relative; z-index: 1; }

.dash-header h1 {
    font-family: var(--pm-font-heading);
    font-size: clamp(1.875rem, 4vw, 2.875rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 .5rem;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.dash-header p {
    color: rgba(255,255,255,.48);
    font-size: 1.05rem;
    margin: 0;
    font-weight: 400;
}

/* ============================================================
   STAT CARDS — float up over dark header
   ============================================================ */
.dash-stats-row {
    margin-top: -3.75rem;
    position: relative;
    z-index: 10;
    margin-bottom: 3.5rem !important;
}

.stat-card {
    background: var(--pm-surface);
    border-radius: var(--pm-radius-xl);
    padding: 1.5rem 1.375rem;
    display: flex;
    align-items: center;
    gap: 1.125rem;
    box-shadow: var(--pm-shadow-xl);
    border: 1px solid rgba(255,255,255,.7);
    transition: transform var(--pm-transition-slow), box-shadow var(--pm-transition-slow);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Gradient left accent stripe */
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    opacity: 0;
    transition: opacity var(--pm-transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pm-shadow-2xl);
}

.stat-card:hover::before { opacity: 1; }

/* Per-card accent stripes */
.stat-card:nth-child(1)::before { background: linear-gradient(180deg, #6366f1, #8b5cf6); }
.stat-card:nth-child(2)::before { background: linear-gradient(180deg, #10b981, #059669); }
.stat-card:nth-child(3)::before { background: linear-gradient(180deg, #06b6d4, #0891b2); }
.stat-card:nth-child(4)::before { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }

.stat-icon {
    width: 54px; height: 54px;
    border-radius: var(--pm-radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.stat-icon.indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 6px 18px rgba(99,102,241,.42); }
.stat-icon.green  { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 6px 18px rgba(16,185,129,.42); }
.stat-icon.cyan   { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; box-shadow: 0 6px 18px rgba(6,182,212,.42); }
.stat-icon.violet { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; box-shadow: 0 6px 18px rgba(139,92,246,.42); }

.stat-value {
    font-family: var(--pm-font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--pm-gray-900);
    line-height: 1;
    margin-bottom: .3125rem;
    letter-spacing: -.04em;
}

.stat-label {
    font-size: .7rem;
    font-weight: 700;
    color: var(--pm-gray-400);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.dash-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.dash-section-title {
    font-family: var(--pm-font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--pm-gray-900);
    margin: 0;
    letter-spacing: -.035em;
}

/* ============================================================
   CATEGORY CARDS — HSL dynamic color
   ============================================================ */
.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.75rem 1.125rem;
    border-radius: var(--pm-radius-2xl);
    text-decoration: none;
    transition: transform var(--pm-transition-slow), box-shadow var(--pm-transition-slow), border-color var(--pm-transition-slow);
    border: 1.5px solid hsl(var(--cat-hue, 254), 55%, 88%);
    background: linear-gradient(160deg,
        hsl(var(--cat-hue, 254), 80%, 97%) 0%,
        hsl(var(--cat-hue, 254), 70%, 93%) 100%);
    color: hsl(var(--cat-hue, 254), 45%, 30%);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Gradient top-bar */
.cat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        hsl(var(--cat-hue, 254), 72%, 62%),
        hsl(var(--cat-hue, 254), 82%, 72%));
    border-radius: var(--pm-radius-2xl) var(--pm-radius-2xl) 0 0;
    opacity: .55;
    transition: opacity var(--pm-transition);
}

/* Subtle inner glow */
.cat-card::after {
    content: '';
    position: absolute;
    bottom: -20%; right: -20%;
    width: 80%; height: 80%;
    background: radial-gradient(circle, hsl(var(--cat-hue,254), 80%, 85%) 0%, transparent 70%);
    opacity: .25;
    pointer-events: none;
}

.cat-card:hover {
    transform: translateY(-6px) scale(1.025);
    box-shadow: 0 18px 36px hsl(var(--cat-hue, 254) 65% 78% / .35);
    text-decoration: none;
    color: hsl(var(--cat-hue, 254), 45%, 24%);
    border-color: hsl(var(--cat-hue, 254), 60%, 80%);
}

.cat-card:hover::before { opacity: 1; }

.cat-emoji {
    font-size: 2.25rem;
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: hsl(var(--cat-hue, 254), 68%, 92%);
    border-radius: var(--pm-radius-xl);
    margin-bottom: .875rem;
    flex-shrink: 0;
    box-shadow:
        0 4px 12px hsl(var(--cat-hue, 254) 65% 78% / .4),
        inset 0 1px 0 rgba(255,255,255,.6);
    transition: transform var(--pm-transition);
    border: 1px solid hsl(var(--cat-hue, 254), 55%, 86%);
    position: relative;
    z-index: 1;
}

.cat-card:hover .cat-emoji { transform: scale(1.18) rotate(-8deg); }

.cat-name {
    font-size: .9375rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    font-family: var(--pm-font-heading);
    letter-spacing: -.015em;
    position: relative;
    z-index: 1;
}

.cat-count {
    font-size: .75rem;
    opacity: .6;
    font-weight: 600;
    letter-spacing: .02em;
    position: relative;
    z-index: 1;
}

/* Category hue assignments */
.cat-sports                  { --cat-hue: 25;  }
.cat-technology, .cat-tech   { --cat-hue: 215; }
.cat-politics                { --cat-hue: 0;   }
.cat-study, .cat-education   { --cat-hue: 142; }
.cat-cinema, .cat-movies     { --cat-hue: 38;  }
.cat-music                   { --cat-hue: 280; }
.cat-food                    { --cat-hue: 16;  }
.cat-travel                  { --cat-hue: 192; }
.cat-science                 { --cat-hue: 162; }
.cat-health                  { --cat-hue: 330; }
.cat-gaming                  { --cat-hue: 254; }
.cat-index-0                 { --cat-hue: 254; }
.cat-index-1                 { --cat-hue: 192; }
.cat-index-2                 { --cat-hue: 25;  }
.cat-index-3                 { --cat-hue: 142; }
.cat-index-4                 { --cat-hue: 0;   }
.cat-index-5                 { --cat-hue: 330; }
.cat-index-6                 { --cat-hue: 215; }
.cat-index-7                 { --cat-hue: 38;  }

/* ============================================================
   POLL CARDS — dashboard list
   ============================================================ */
.poll-card {
    display: flex;
    flex-direction: column;
    background: var(--pm-surface);
    border-radius: var(--pm-radius-xl);
    padding: 1.625rem;
    text-decoration: none;
    color: var(--pm-gray-700);
    border: 1.5px solid var(--pm-gray-200);
    box-shadow: var(--pm-shadow-sm);
    transition: all var(--pm-transition-slow);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Gradient accent top border */
.poll-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--pm-gradient-brand);
    border-radius: var(--pm-radius-xl) var(--pm-radius-xl) 0 0;
    opacity: 0;
    transition: opacity var(--pm-transition);
}

.poll-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pm-shadow-xl);
    border-color: rgba(99,102,241,.2);
    text-decoration: none;
    color: var(--pm-gray-700);
}

.poll-card:hover::before { opacity: 1; }

.poll-card-question {
    font-family: var(--pm-font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--pm-gray-900);
    margin: 0 0 .625rem;
    line-height: 1.42;
    letter-spacing: -.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poll-card-desc {
    font-size: .875rem;
    color: var(--pm-gray-400);
    margin: 0 0 1rem;
    line-height: 1.58;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.poll-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-top: auto;
    padding-top: .875rem;
    border-top: 1px solid var(--pm-gray-100);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--pm-surface);
    border-radius: var(--pm-radius-2xl);
    border: 2px dashed var(--pm-gray-200);
}

.empty-state-icon {
    font-size: 3.5rem;
    color: var(--pm-gray-300);
    margin-bottom: 1.25rem;
    display: block;
}

.empty-state h4 {
    font-family: var(--pm-font-heading);
    color: var(--pm-gray-700);
    font-weight: 700;
    margin-bottom: .5rem;
    font-size: 1.3125rem;
}

.empty-state p {
    color: var(--pm-gray-400);
    font-size: .9375rem;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.68;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    .dash-header     { padding: 2.75rem 0 5.75rem; }
    .dash-stats-row  { margin-top: -3rem; }
    .stat-card       { padding: 1.25rem 1.125rem; }
    .stat-value      { font-size: 1.75rem; }
    .cat-card        { padding: 1.5rem .875rem; }
    .cat-emoji       { width: 56px; height: 56px; font-size: 1.875rem; }
}

@media (max-width: 479px) {
    .stat-card   { gap: .875rem; }
    .stat-icon   { width: 46px; height: 46px; font-size: 1.15rem; }
    .stat-value  { font-size: 1.5rem; }
    .dash-header h1 { font-size: 1.625rem; }
}
