/* ============================
   CSS Variables & Reset
   FAREWELL ROSE THEME - Juniors' Love for Seniors
   ============================ */
:root {
    --primary: #e63946;
    --primary-light: #ff6b6b;
    --primary-dark: #c1121f;
    --secondary: #ff8fa3;
    --accent: #ffb3c1;
    --gold: #fdcb6e;
    --silver: #b2bec3;
    --bronze: #e17055;
    --bg-dark: #1a0a0e;
    --bg-card: #2a0f15;
    --bg-card-hover: #3d1520;
    --text-primary: #fff0f3;
    --text-secondary: #d4a0aa;
    --text-muted: #8c5a65;
    --border: #4a1a25;
    --success: #ff6b6b;
    --danger: #e74c3c;
    --warning: #f39c12;
    --shadow: rgba(230, 57, 70, 0.25);
    --gradient-1: linear-gradient(135deg, #e63946, #ff6b6b);
    --gradient-2: linear-gradient(135deg, #ff8fa3, #ffb3c1);
    --gradient-3: linear-gradient(135deg, #c1121f, #e63946);
    --rose-glow: rgba(255, 107, 107, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================
   Falling Rose Petals (CSS-only)
   ============================ */
.rose-petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    top: -60px;
    opacity: 0;
    animation: petal-fall linear infinite;
}

.petal::before {
    content: '\1F339';
    font-size: 1.5rem;
    display: block;
}

.petal:nth-child(1)  { left: 5%;  animation-duration: 12s; animation-delay: 0s; }
.petal:nth-child(2)  { left: 15%; animation-duration: 14s; animation-delay: 2s; }
.petal:nth-child(3)  { left: 25%; animation-duration: 10s; animation-delay: 4s; }
.petal:nth-child(4)  { left: 35%; animation-duration: 16s; animation-delay: 1s; }
.petal:nth-child(5)  { left: 45%; animation-duration: 11s; animation-delay: 3s; }
.petal:nth-child(6)  { left: 55%; animation-duration: 13s; animation-delay: 5s; }
.petal:nth-child(7)  { left: 65%; animation-duration: 15s; animation-delay: 0.5s; }
.petal:nth-child(8)  { left: 75%; animation-duration: 12s; animation-delay: 2.5s; }
.petal:nth-child(9)  { left: 85%; animation-duration: 14s; animation-delay: 4.5s; }
.petal:nth-child(10) { left: 95%; animation-duration: 10s; animation-delay: 1.5s; }
.petal:nth-child(11) { left: 10%; animation-duration: 13s; animation-delay: 6s; }
.petal:nth-child(12) { left: 30%; animation-duration: 11s; animation-delay: 7s; }
.petal:nth-child(13) { left: 50%; animation-duration: 15s; animation-delay: 3.5s; }
.petal:nth-child(14) { left: 70%; animation-duration: 12s; animation-delay: 5.5s; }
.petal:nth-child(15) { left: 90%; animation-duration: 14s; animation-delay: 2.2s; }

.petal:nth-child(odd)::before {
    content: '\1F338';
    font-size: 1.2rem;
}

.petal:nth-child(3n)::before {
    content: '\1F490';
    font-size: 1rem;
}

@keyframes petal-fall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(40px);
        opacity: 0.6;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) translateX(-30px);
        opacity: 0;
    }
}

/* ============================
   Animated Background
   ============================ */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -80px;
    left: -80px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: var(--gold);
    top: 30%;
    left: 10%;
    animation-delay: -7s;
}

.shape-5 {
    width: 250px;
    height: 250px;
    background: var(--primary-light);
    bottom: 20%;
    right: 10%;
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(50px, -50px) rotate(90deg) scale(1.1); }
    50% { transform: translate(-30px, 80px) rotate(180deg) scale(0.9); }
    75% { transform: translate(60px, 30px) rotate(270deg) scale(1.05); }
}

/* ============================
   Landing Page
   ============================ */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 40px 20px;
}

.landing-content {
    text-align: center;
    max-width: 900px;
    width: 100%;
}

/* Farewell message */
.farewell-message {
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
}

.farewell-message p {
    font-size: 1.1rem;
    color: var(--secondary);
    font-style: italic;
    line-height: 1.6;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.farewell-message .heart-divider {
    font-size: 1.5rem;
    margin: 15px 0;
    animation: heartbeat 1.5s infinite;
    display: block;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
}

.logo-section {
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out;
}

.logo-icon {
    font-size: 70px;
    color: var(--primary);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 20px rgba(230, 57, 70, 0.5));
}

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

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.title-fare {
    color: var(--primary-light);
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.4);
    font-family: 'Pacifico', cursive;
}

.title-well {
    color: var(--accent);
    text-shadow: 0 0 30px rgba(255, 179, 193, 0.4);
    font-family: 'Pacifico', cursive;
}

.title-polls {
    display: block;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Big Vote Button */
.vote-button-wrapper {
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.vote-big-btn {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: var(--gradient-1);
    color: white;
    padding: 28px 70px;
    border-radius: 60px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(230, 57, 70, 0.4), 0 0 80px rgba(230, 57, 70, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    animation: vote-btn-glow 2s ease-in-out infinite alternate;
}

.vote-big-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    animation: btn-shine 3s linear infinite;
}

@keyframes btn-shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes vote-btn-glow {
    from { box-shadow: 0 10px 40px rgba(230, 57, 70, 0.4), 0 0 60px rgba(230, 57, 70, 0.15); }
    to { box-shadow: 0 15px 60px rgba(230, 57, 70, 0.6), 0 0 120px rgba(230, 57, 70, 0.25); }
}

.vote-big-btn:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 20px 80px rgba(230, 57, 70, 0.5), 0 0 120px rgba(230, 57, 70, 0.3);
}

.vote-big-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.vote-big-btn i {
    font-size: 2rem;
    animation: heartbeat 1.5s infinite;
}

/* Admin hyperlink - subtle */
.admin-link-subtle {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 30px;
    opacity: 0.35;
    transition: opacity 0.3s;
    text-decoration: none;
    animation: fadeIn 2s ease-out 1s both;
}

.admin-link-subtle:hover {
    opacity: 0.7;
    color: var(--text-secondary);
    text-decoration: underline;
}

.landing-footer {
    position: absolute;
    bottom: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================
   Page Layout (Admin & User)
   ============================ */
.page-container {
    min-height: 100vh;
    padding: 0;
}

/* Navbar */
.navbar {
    background: rgba(42, 15, 21, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
}

.nav-brand i {
    color: var(--primary);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(230, 57, 70, 0.5));
}

.nav-brand .brand-fare {
    color: var(--primary-light);
    font-family: 'Pacifico', cursive;
}

.nav-brand .brand-well {
    color: var(--accent);
    font-family: 'Pacifico', cursive;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: rgba(230, 57, 70, 0.15);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-header {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================
   Buttons
   ============================ */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.btn-secondary {
    background: rgba(230, 57, 70, 0.15);
    color: var(--primary-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(230, 57, 70, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, #ff6b6b, #ff8fa3);
    color: #1a0a0e;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* ============================
   Admin - Create Poll Modal
   ============================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--shadow);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.candidate-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    animation: fadeInUp 0.3s ease-out;
}

.candidate-input-row input {
    flex: 1;
}

.remove-candidate-btn {
    background: rgba(231, 76, 60, 0.15);
    border: none;
    color: var(--danger);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.remove-candidate-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

.add-candidate-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 2px dashed rgba(255, 107, 107, 0.3);
    color: var(--success);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.add-candidate-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: var(--success);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* ============================
   Poll Cards
   ============================ */
.polls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.6s ease-out;
}

/* Admin Polls List (minimal) */
.polls-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-poll-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-poll-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.admin-poll-info {
    flex: 1;
    min-width: 250px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-poll-info h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.admin-poll-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.admin-poll-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-poll-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


.admin-poll-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-poll-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.admin-poll-info {
    flex: 1;
    min-width: 250px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-poll-info h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.admin-poll-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.admin-poll-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-poll-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.poll-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.poll-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s;
}

.poll-card:hover {
    border-color: rgba(230, 57, 70, 0.3);
    box-shadow: 0 10px 40px rgba(230, 57, 70, 0.15);
    transform: translateY(-4px);
}

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

.poll-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.poll-card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
    margin-right: 12px;
}

.poll-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.poll-status.published {
    background: rgba(255, 107, 107, 0.15);
    color: var(--success);
}

.poll-status.draft {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.poll-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.poll-candidates-preview {
    margin-bottom: 20px;
}

.poll-candidates-preview h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.candidate-chip {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 3px 4px;
    color: var(--primary-light);
}

.poll-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.poll-total-votes {
    display: flex;
    align-items: center;
    gap: 6px;
}

.poll-actions {
    display: flex;
    gap: 8px;
}

/* ============================
   User - Voting Section (Mobile-First)
   ============================ */
.voting-section {
    animation: fadeInUp 0.6s ease-out;
}

.vote-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 16px;
    -webkit-tap-highlight-color: transparent;
}

.vote-option:hover {
    border-color: var(--primary);
    background: rgba(230, 57, 70, 0.05);
    transform: scale(1.01);
}

.vote-option.selected {
    border-color: var(--primary);
    background: rgba(230, 57, 70, 0.12);
    box-shadow: 0 0 0 3px var(--shadow), 0 4px 20px rgba(230, 57, 70, 0.2);
    transform: scale(1.02);
}

.vote-radio {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.vote-option.selected .vote-radio {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 12px rgba(230, 57, 70, 0.5);
}

.vote-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    transform: scale(0);
    transition: all 0.3s;
}

.vote-option.selected .vote-radio::after {
    transform: scale(1);
}

.vote-option-name {
    font-size: 1.1rem;
    font-weight: 500;
}

.vote-submit-section {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.vote-submit-section .btn {
    width: 100%;
    max-width: 400px;
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 50px;
    justify-content: center;
}

.already-voted {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.already-voted i {
    font-size: 2.5rem;
    color: var(--success);
    margin-bottom: 12px;
}

.already-voted h3 {
    color: var(--success);
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.already-voted p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================
   Poll List View (Click to Expand)
   ============================ */
.poll-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out;
}

.poll-list-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(230, 57, 70, 0.15);
    transform: translateY(-2px);
}

.poll-list-item.voted {
    cursor: default;
    opacity: 0.7;
}

.poll-list-item.voted:hover {
    transform: none;
}

.poll-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.poll-list-info {
    flex: 1;
}

.poll-list-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.poll-list-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.poll-list-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.1);
    transition: all 0.3s;
}

.poll-list-action i {
    color: var(--primary);
    transition: transform 0.3s;
}

.poll-list-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.poll-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.poll-list-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================
   Results Page
   ============================ */
.results-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.results-loading {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.3rem;
    color: var(--text-secondary);
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
    0%  { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Winner Announcement */
.winner-section {
    text-align: center;
    margin-bottom: 60px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-section.reveal {
    opacity: 1;
    transform: scale(1);
}

.winner-crown {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce-in 0.6s ease-out;
}

@keyframes bounce-in {
    0%  { transform: scale(0) rotate(-20deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(10deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100%{ transform: scale(1) rotate(0deg); opacity: 1; }
}

.winner-poll-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--secondary);
    margin-bottom: 10px;
    font-weight: 600;
}

.winner-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--gold);
    margin-bottom: 10px;
    font-weight: 600;
    display: none;
}

.winner-name {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    background-size: 200% 200%;
    animation: winner-gradient 3s ease infinite, glow 2s ease-in-out infinite alternate;
}

@keyframes winner-gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glow {
    from { filter: drop-shadow(0 0 5px rgba(230, 57, 70, 0.3)); }
    to   { filter: drop-shadow(0 0 30px rgba(230, 57, 70, 0.6)); }
}

.winner-votes {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Animated Bar Race Section */
.bar-race-section {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.bar-race-section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.bar-race-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.bar-race-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
}

.bar-race-item {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.bar-race-item:last-child {
    margin-bottom: 0;
}

.bar-race-name {
    min-width: 100px;
    max-width: 120px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-race-bar-wrapper {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    height: 40px;
    overflow: hidden;
    position: relative;
}

.bar-race-bar {
    height: 100%;
    border-radius: 12px;
    width: 0;
    transition: width 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.bar-race-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    animation: bar-shimmer 2s linear infinite;
}

@keyframes bar-shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

.bar-race-votes {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.bar-race-count {
    min-width: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-light);
    text-align: left;
}

/* Podium */
.podium-section {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.podium-section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.podium-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: var(--text-secondary);
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding: 0 20px;
    min-height: 350px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 200px;
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.podium-place.reveal {
    opacity: 1;
    transform: translateY(0);
}

.podium-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    border: 3px solid;
}

.podium-place-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

.podium-place-votes {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.podium-bar {
    width: 100%;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    font-size: 2rem;
    font-weight: 800;
    transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.podium-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}

.place-1 .podium-avatar {
    border-color: var(--gold);
    background: rgba(253, 203, 110, 0.15);
    color: var(--gold);
}

.place-1 .podium-bar {
    background: linear-gradient(180deg, var(--gold), #e4a817);
    height: 200px;
    color: #1a1a1a;
}

.place-2 .podium-avatar {
    border-color: var(--silver);
    background: rgba(178, 190, 195, 0.15);
    color: var(--silver);
}

.place-2 .podium-bar {
    background: linear-gradient(180deg, var(--silver), #95a5a6);
    height: 150px;
    color: #1a1a1a;
}

.place-3 .podium-avatar {
    border-color: var(--bronze);
    background: rgba(225, 112, 85, 0.15);
    color: var(--bronze);
}

.place-3 .podium-bar {
    background: linear-gradient(180deg, var(--bronze), #c0392b);
    height: 110px;
    color: #1a1a1a;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.charts-section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.chart-card h3 {
    font-size: 1.2rem;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.chart-wrapper {
    position: relative;
    max-height: 400px;
}

/* All Results Table */
.results-table-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.results-table-section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.results-table thead th {
    text-align: left;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.results-table tbody tr {
    background: var(--bg-card);
    transition: all 0.3s;
}

.results-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.results-table td {
    padding: 16px 20px;
    font-size: 0.95rem;
}

.results-table td:first-child {
    border-radius: 12px 0 0 12px;
}

.results-table td:last-child {
    border-radius: 0 12px 12px 0;
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-1 { background: rgba(253, 203, 110, 0.2); color: var(--gold); }
.rank-2 { background: rgba(178, 190, 195, 0.2); color: var(--silver); }
.rank-3 { background: rgba(225, 112, 85, 0.2); color: var(--bronze); }
.rank-other { background: rgba(230, 57, 70, 0.1); color: var(--text-muted); }

.vote-bar-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    min-width: 100px;
}

.vote-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: var(--gradient-1);
    transition: width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 0;
}

/* ============================
   Confetti
   ============================ */
.confetti-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 14px;
    top: -20px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ============================
   Empty State
   ============================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    animation: fadeInUp 0.6s ease-out;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================
   Toast
   ============================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideInRight 0.4s ease-out;
    transition: all 0.3s;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error   { border-left: 4px solid var(--danger); }
.toast.toast-info    { border-left: 4px solid var(--primary); }

.toast i { font-size: 1.2rem; }
.toast.toast-success i { color: var(--success); }
.toast.toast-error i   { color: var(--danger); }
.toast.toast-info i    { color: var(--primary); }

.toast-message { flex: 1; font-size: 0.9rem; }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.toast.removing {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ============================
   Utility Animations
   ============================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 8px 0;
    transition: all 0.3s;
}

.back-link:hover {
    color: var(--primary-light);
}

/* ============================
   Scrollbar
   ============================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================
   User Page Mobile Optimizations
   ============================ */
.user-page .main-content {
    max-width: 600px;
    padding: 20px 16px;
}

.user-page .poll-card {
    border-radius: 16px;
    padding: 20px;
}

.user-page .navbar {
    padding: 12px 16px;
}

/* ============================
   Admin Page PC Optimizations
   ============================ */
.admin-page .main-content {
    max-width: 1400px;
}

.admin-page .polls-grid {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ============================
   Responsive Breakpoints
   ============================ */
@media (max-width: 768px) {
    .main-title { font-size: 2.5rem; line-height: 1.2; }
    .subtitle { font-size: 0.95rem; }

    .vote-big-btn {
        padding: 22px 50px;
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .navbar {
        padding: 12px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-brand { font-size: 1.1rem; }

    .nav-links {
        gap: 8px;
        width: 100%;
        justify-content: center;
    }

    .nav-links a { font-size: 0.85rem; padding: 6px 12px; }

    .main-content { padding: 30px 16px; }
    .page-header { margin-bottom: 30px; }
    .page-header h1 { font-size: 1.5rem; }
    .page-header p { font-size: 0.9rem; }

    .polls-grid { grid-template-columns: 1fr; gap: 20px; }
    .poll-card { padding: 20px; }
    .candidate-chip { font-size: 0.8rem; padding: 5px 12px; }

    .btn { padding: 10px 20px; font-size: 0.85rem; }
    .btn-sm { padding: 6px 12px; font-size: 0.75rem; }

    .poll-actions { flex-direction: column; align-items: stretch; }
    .poll-actions .btn { width: 100%; justify-content: center; }

    .modal { padding: 20px; width: 95%; max-width: 500px; max-height: 90vh; }
    .modal-header h2 { font-size: 1.3rem; }

    .form-group input,
    .form-group textarea,
    .form-group select { font-size: 16px; padding: 12px 16px; }

    .vote-option { padding: 18px 20px; font-size: 1rem; }
    .vote-submit-section .btn { width: 100%; padding: 18px 32px; font-size: 1.1rem; }

    .results-container { padding: 30px 16px; }
    .winner-section { margin-bottom: 50px; }
    .winner-crown { font-size: 3rem; }
    .winner-name { font-size: 2rem; }
    .winner-votes { font-size: 1rem; }

    .podium { flex-direction: column; align-items: center; gap: 20px; min-height: auto; }
    .podium-place { width: 100%; max-width: 280px; }
    .podium-bar { height: 80px !important; width: 100%; }

    .chart-card { padding: 20px; }
    .chart-wrapper { max-height: 300px; }

    .bar-race-name { min-width: 60px; max-width: 80px; font-size: 0.75rem; }
    .bar-race-bar-wrapper { height: 32px; }

    .results-table { font-size: 0.8rem; }
    .results-table td, .results-table th { padding: 12px 10px; }
    .rank-badge { width: 28px; height: 28px; font-size: 0.75rem; }

    .toast-container { right: 10px; top: 10px; }
    .toast { min-width: 280px; padding: 14px 18px; font-size: 0.85rem; }

    .password-box, .confirm-box { padding: 30px 20px; width: 90%; max-width: 350px; }
    .password-box h2, .confirm-box h3 { font-size: 1.2rem; }

    .petal::before { font-size: 1rem; }
    .farewell-message p { font-size: 0.95rem; }

    .admin-page .page-header::after {
        content: 'Best viewed on desktop';
        display: block;
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-top: 6px;
        font-style: italic;
    }
}

@media (max-width: 480px) {
    .main-title { font-size: 1.8rem; }
    .title-polls { font-size: 1rem; letter-spacing: 4px; }
    .logo-icon { font-size: 48px; }

    .vote-big-btn {
        padding: 20px 40px;
        font-size: 1.1rem;
        letter-spacing: 1px;
        width: 90%;
        justify-content: center;
    }

    .navbar { flex-direction: column; text-align: center; padding: 10px 16px; }
    .nav-links { flex-wrap: wrap; }

    .page-header h1 { font-size: 1.3rem; }
    .page-header div { flex-direction: column; align-items: flex-start !important; }
    .page-header .btn { width: 100%; margin-top: 10px; }

    .modal { padding: 16px; }
    .modal-header { margin-bottom: 20px; }
    .modal-actions { flex-direction: column; gap: 8px; }
    .modal-actions .btn { width: 100%; }

    .candidate-input-row { flex-direction: column; gap: 8px; }
    .remove-candidate-btn { width: 100%; height: 36px; }

    .vote-option { padding: 16px 16px; }
    .vote-option-name { font-size: 0.95rem; }

    .winner-name { font-size: 1.6rem; }
    .winner-poll-title { font-size: 0.85rem; letter-spacing: 2px; }
    .podium-section h2 { font-size: 1.2rem; }
    .chart-card h3 { font-size: 1rem; }

    .results-table { display: block; overflow-x: auto; white-space: nowrap; }

    #statsRow { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    #statsRow .poll-card { padding: 16px; }

    .landing-footer { font-size: 0.7rem; }
    .floating-shape { opacity: 0.04; }
}

/* ============================
   Admin Password Modal
   ============================ */
.password-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    animation: fadeInUp 0.5s ease-out;
}

.password-box h2 { font-size: 1.5rem; margin-bottom: 8px; }
.password-box p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.9rem; }
.password-box .form-group { text-align: left; }
.password-box .btn { width: 100%; justify-content: center; margin-top: 8px; }

.password-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 8px;
    display: none;
}

/* Delete confirmation */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-overlay.active .confirm-box {
    transform: scale(1);
}

.confirm-box i { font-size: 3rem; color: var(--danger); margin-bottom: 16px; }
.confirm-box h3 { font-size: 1.2rem; margin-bottom: 8px; }
.confirm-box p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }
