/* =====================================================
   POLIMÉTRICA - Encuestas Rápidas - Public CSS
   Dark theme, consistent with existing admin
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --bg-input: #15151f;
    --border-color: #2a2a3a;
    --border-active: #6c5ce7;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --success: #00cec9;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --info: #74b9ff;
    --gradient-primary: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-card: linear-gradient(145deg, #1a1a25, #15151f);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.content-narrow {
    max-width: 640px;
    margin: 0 auto;
}

.content-medium {
    max-width: 860px;
    margin: 0 auto;
}

/* === NAVBAR === */
.navbar {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
}

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

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-user .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.navbar-user .user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.navbar-user .user-level {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-twitter {
    background: #1d9bf0;
    color: white;
}
.btn-twitter:hover {
    background: #1a8cd8;
}

/* === CARDS === */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* === POLL CARD === */
.poll-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.poll-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.poll-card:hover {
    border-color: rgba(108, 92, 231, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.poll-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.poll-category {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Space Mono', monospace;
}

.cat-politica { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.cat-economia { background: rgba(253,203,110,0.15); color: #fdcb6e; }
.cat-sociedad { background: rgba(116,185,255,0.15); color: #74b9ff; }
.cat-deportes { background: rgba(0,206,201,0.15); color: #00cec9; }
.cat-tecnologia { background: rgba(108,92,231,0.15); color: #a29bfe; }
.cat-cultura { background: rgba(255,159,243,0.15); color: #ff9ff3; }
.cat-salud { background: rgba(85,239,196,0.15); color: #55efc4; }
.cat-educacion { background: rgba(162,155,254,0.15); color: #a29bfe; }
.cat-medio_ambiente { background: rgba(0,184,148,0.15); color: #00b894; }
.cat-internacional { background: rgba(9,132,227,0.15); color: #0984e3; }
.cat-otro { background: rgba(136,136,160,0.15); color: #8888a0; }

.poll-question {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.poll-question a {
    color: inherit;
    text-decoration: none;
}

.poll-question a:hover {
    color: var(--accent-secondary);
}

/* === POLL OPTIONS (voting) === */
.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.poll-option {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: all 0.25s;
    overflow: hidden;
    background: var(--bg-input);
}

.poll-option:hover {
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.05);
}

.poll-option.selected {
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.1);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.poll-option input[type="radio"] {
    display: none;
}

.poll-option-text {
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* === POLL RESULTS (after voting) === */
.poll-result {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    background: var(--bg-input);
}

.poll-result-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: var(--radius-md);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.15;
}

.poll-result-bar.winner { opacity: 0.25; }

.poll-result-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.poll-result-text {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.poll-result-text .voted-check {
    color: var(--accent-primary);
    font-size: 0.85rem;
}

.poll-result-percent {
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
}

/* === POLL FOOTER === */
.poll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.poll-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.poll-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.poll-actions {
    display: flex;
    gap: 0.5rem;
}

.poll-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1rem;
}

.poll-action-btn:hover {
    color: var(--accent-secondary);
    background: var(--bg-card);
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Space Mono', monospace;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* === AUTH PAGES === */
.auth-container {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-glow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
}

/* === ALERTS === */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-success {
    background: rgba(0, 206, 201, 0.1);
    border-color: rgba(0, 206, 201, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(116, 185, 255, 0.1);
    border-color: rgba(116, 185, 255, 0.3);
    color: var(--info);
}

/* === GRID ENCUESTAS === */
.polls-grid {
    display: grid;
    gap: 1.25rem;
}

.polls-grid.two-cols {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* === FILTROS === */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-chip:hover,
.filter-chip.active {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(108, 92, 231, 0.1);
}

/* === TABS === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-primary);
}

/* === STATS DASHBOARD === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Space Mono', monospace;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* === BADGE NIVEL === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-bronce { background: rgba(205,127,50,0.15); color: #cd7f32; }
.badge-plata { background: rgba(192,192,192,0.15); color: #c0c0c0; }
.badge-oro { background: rgba(255,215,0,0.15); color: #ffd700; }
.badge-platino { background: rgba(162,155,254,0.15); color: #a29bfe; }

.badge-publica { background: rgba(0,206,201,0.15); color: var(--success); }
.badge-privada { background: rgba(255,107,107,0.15); color: var(--danger); }
.badge-por_enlace { background: rgba(253,203,110,0.15); color: var(--warning); }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* === SHARE MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    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-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-glow);
    transform: scale(0.95);
    transition: transform 0.3s;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* === FOOTER === */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

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

/* === HERO SECTION === */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

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

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    .hero-section h1 { font-size: 1.75rem; }
    .polls-grid.two-cols { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .navbar-links { display: none; }
    .auth-card { padding: 1.75rem; }
    .stat-card { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filters-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.5rem; }
}

@media (max-width: 480px) {
    .poll-card { padding: 1.25rem; }
    .poll-question { font-size: 1.05rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* === HAMBURGER MOBILE === */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
}
