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

:root {
    --bg-primary: #08090c;
    --bg-secondary: #11141e;
    --accent-blue: #0ea5e9;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-pink: #ec4899;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --glow-blue: 0 0 20px rgba(14, 165, 233, 0.3);
    --glow-purple: 0 0 25px rgba(139, 92, 246, 0.3);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: radial-gradient(circle at 50% 50%, #181927 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, .score-display {
    font-family: 'Outfit', sans-serif;
}

/* Glassmorphism Container */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Header & Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(8, 9, 12, 0.6);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 16px;
}

/* Main Layout Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    gap: 24px;
    padding: 24px 40px;
    max-width: 1800px;
    margin: 0 auto;
    height: calc(100vh - 80px);
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding-bottom: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-purple);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Forms and Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.input-text {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.input-text:focus {
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

/* QR Code Panel */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    text-align: center;
}

.qr-box {
    background: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin: 16px 0;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-link {
    font-size: 12px;
    color: var(--accent-blue);
    word-break: break-all;
    user-select: all;
    background: rgba(14, 165, 233, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px dashed rgba(14, 165, 233, 0.3);
}

/* Settings Card */
.settings-panel {
    padding: 24px;
}

.settings-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Active Speaker Card (Large Main View) */
.active-speaker-panel {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    position: relative;
    overflow: hidden;
}

.active-speaker-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

.status-badge {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-idle {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.status-voting {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
    animation: pulse 2s infinite;
}

.status-done {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.active-name-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 16px;
}

.active-speaker-name {
    font-size: 48px;
    font-weight: 800;
    margin: 8px 0 24px 0;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

/* Voting Progress Status */
.progress-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.progress-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill-judge {
    background: linear-gradient(90deg, var(--accent-blue), #38bdf8);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.progress-fill-voter {
    background: linear-gradient(90deg, var(--accent-purple), #a78bfa);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* Reveal Score Section */
.reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 16px;
}

.reveal-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.score-display {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    color: white;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 4px;
    animation: popScore 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popScore {
    0% { transform: scale(0.6); opacity: 0; filter: blur(10px); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.score-display.revealed {
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
}

.score-display span.points {
    font-size: 24px;
    font-weight: 600;
    -webkit-text-fill-color: initial;
    color: var(--text-secondary);
}

/* Speakers Management list */
.list-panel {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.panel-title {
    font-size: 18px;
    font-weight: 700;
}

.speakers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}

.speaker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.speaker-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.speaker-item.active-voting {
    border-color: var(--accent-blue);
    background: rgba(14, 165, 233, 0.04);
}

.speaker-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.speaker-name {
    font-size: 15px;
    font-weight: 600;
}

.speaker-status-inline {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.speaker-status-inline span strong {
    color: var(--text-primary);
}

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

/* Leaderboard Panel */
.leaderboard-panel {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    margin-top: 16px;
}

.leader-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leader-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.leader-item:nth-child(1) {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.3);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.05);
}
.leader-item:nth-child(1) .leader-rank {
    background: #eab308;
    color: #0f172a;
}

.leader-item:nth-child(2) {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.3);
}
.leader-item:nth-child(2) .leader-rank {
    background: #cbd5e1;
    color: #0f172a;
}

.leader-item:nth-child(3) {
    background: rgba(180, 83, 9, 0.08);
    border-color: rgba(180, 83, 9, 0.3);
}
.leader-item:nth-child(3) .leader-rank {
    background: #d97706;
    color: #fff;
}

.leader-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.leader-score {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue);
}

.leader-item:nth-child(1) .leader-score {
    color: #facc15;
    font-size: 18px;
}

/* Modal and Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 9, 12, 0.85);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 32px;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

/* Presentation Screen Mode */
body.presentation-mode {
    background: radial-gradient(circle at 50% 50%, #111424 0%, #030406 100%);
}

body.presentation-mode header,
body.presentation-mode .dashboard-grid > .dashboard-column:nth-child(1),
body.presentation-mode .dashboard-grid > .dashboard-column:nth-child(2) > .list-panel {
    display: none !important;
}

body.presentation-mode .dashboard-grid {
    grid-template-columns: 1fr 450px;
    height: 100vh;
    padding: 40px;
    max-width: 100%;
}

body.presentation-mode .active-speaker-panel {
    min-height: 80vh;
    justify-content: center;
    align-items: center;
    gap: 40px;
    text-align: center;
    border: none;
    background: none;
    box-shadow: none;
}

body.presentation-mode .active-speaker-name {
    font-size: 110px;
    margin: 20px 0;
    text-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
}

body.presentation-mode .active-name-label {
    font-size: 24px;
    letter-spacing: 8px;
}

body.presentation-mode .progress-grid {
    width: 100%;
    max-width: 600px;
}

body.presentation-mode .reveal-container {
    background: none;
    border: none;
    margin: 0;
    padding: 0;
}

body.presentation-mode .reveal-title {
    font-size: 20px;
    letter-spacing: 4px;
}

body.presentation-mode .score-display {
    font-size: 160px;
    margin-bottom: 0;
}

body.presentation-mode .score-display span.points {
    font-size: 48px;
}

/* Floating Presentation Exit button */
.exit-pres-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: none;
}

body.presentation-mode .exit-pres-btn {
    display: flex;
}

/* ==========================================================================
   MOBILE VOTER PAGE STYLING
   ========================================================================== */
.voter-body {
    padding: 16px;
    background: radial-gradient(circle at top, #1A122E 0%, #09090C 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.voter-container {
    width: 100%;
    max-width: 440px;
    padding: 24px 20px;
}

.voter-header {
    text-align: center;
    margin-bottom: 24px;
}

.voter-logo {
    font-size: 24px;
    margin-bottom: 8px;
    display: inline-block;
}

.voter-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.voter-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Active Speaker Banner on Mobile */
.voter-speaker-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.voter-speaker-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(139, 92, 246, 0.05));
    pointer-events: none;
}

.voter-speaker-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-blue);
    font-weight: 700;
    margin-bottom: 8px;
}

.voter-speaker-name {
    font-size: 28px;
    font-weight: 800;
    color: white;
}

/* Role Selection Selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.role-option {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    background: rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.role-option.selected {
    border-color: var(--accent-blue);
    background: rgba(14, 165, 233, 0.08);
    box-shadow: var(--glow-blue);
}

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

.role-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.role-name {
    font-size: 14px;
    font-weight: 600;
}

/* Slider score styling */
.score-slider-container {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 24px;
}

.score-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.score-slider-title {
    font-size: 14px;
    font-weight: 600;
}

.score-value-bubble {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-blue);
}

/* Custom Range Input */
.range-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 12px 0;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Success State Screen on Mobile */
.voter-status-panel {
    text-align: center;
    padding: 40px 20px;
}

.voter-status-icon {
    font-size: 54px;
    margin-bottom: 20px;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.voter-status-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.voter-status-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Details list inside Speaker items (for admin view detailed scores modal) */
.votes-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 16px;
}

.votes-details-col {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
}

.votes-details-col h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.vote-detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.vote-detail-item span.score {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent-blue);
}

.vote-detail-item button {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.7;
    margin-left: 8px;
}

.vote-detail-item button:hover {
    opacity: 1;
    text-decoration: underline;
}

.empty-detail {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 12px 0;
    font-style: italic;
}
