/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

body.board-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Admin Styles */
.admin-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.admin-login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-login-box h1 {
    text-align: center;
    font-size: 48px;
    margin-bottom: 10px;
}

.admin-login-box h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    cursor: not-allowed;
}

.btn-primary.btn-disabled {
    background: #9ca3af;
    color: #e5e7eb;
    cursor: not-allowed;
}

.btn-primary.btn-disabled:hover {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}

.no-votes-message {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #6c757d;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

.btn-secondary:disabled {
    cursor: not-allowed;
}

.btn-secondary.btn-highlight {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    animation: pulseGreen 2s ease-in-out infinite;
}

.btn-secondary.btn-highlight:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea87a 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(40, 167, 69, 0.5);
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.7);
    }
}


.btn-danger {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.4);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    color: #999;
}

/* Admin Dashboard */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    color: #667eea;
    font-size: 28px;
}

.admin-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-change-password {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-change-password:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.create-board-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.create-board-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.create-board-form {
    gap: 15px;
}

.create-board-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.create-board-form button {
    padding: 12px 30px;
    white-space: nowrap;
}

.boards-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.no-boards {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 18px;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.board-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.board-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.board-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.board-card-header h3 {
    color: #667eea;
    font-size: 20px;
    flex: 1;
}

.board-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.board-type-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.guest-badge {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffd700;
}

.admin-board-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border: 1px solid #ffd700;
}

.participant-badge {
    background: #e7f3ff;
    color: #0066cc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.board-info {
    margin-bottom: 20px;
}

.board-info p {
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.board-url {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.board-url input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #f8f9fa;
}

.btn-copy {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-copy:hover {
    background: #218838;
}

.btn-copy.copied {
    background: #20c997;
}

.board-meta {
    font-size: 13px;
    color: #666;
    margin: 8px 0;
}

.board-meta strong {
    color: #333;
}

.expiration-meta {
    color: #856404;
}

.expiration-meta.expired {
    color: #dc3545;
}

.time-left {
    color: #28a745;
    font-weight: 600;
}

.expired-label {
    color: #dc3545;
    font-weight: 700;
    text-transform: uppercase;
}

.permanent-meta {
    color: #28a745;
}

.permanent-label {
    color: #28a745;
    font-weight: 600;
    text-transform: uppercase;
}

.board-actions {
    display: flex;
    gap: 10px;
}

.board-actions button,
.board-actions a {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
}

/* Board Styles */
.board-body {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 20px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
}

.join-modal-card {
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.join-modal-icon {
    font-size: 48px;
    line-height: 1;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.modal-content h3 {
    color: #999;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 400;
}

.join-modal-subtitle {
    color: #6c7280;
    font-size: 14px;
    margin: -10px 0 10px 0;
}

.join-modal-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.join-modal-form .form-group {
    text-align: left;
}

.join-modal-form .btn-primary {
    align-self: center;
    width: auto;
    min-width: 160px;
    padding: 12px 28px;
    font-size: 15px;
}

@media (max-width: 480px) {
    .join-modal-card {
        padding: 28px 24px;
        gap: 14px;
    }

    .join-modal-icon {
        font-size: 42px;
    }

    .join-modal-subtitle {
        font-size: 13px;
    }
}

/* Board Container */
#boardContainer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Main Board Container */
.board-main-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

/* Board Header */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.board-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.spectator-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.spectator-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.spectator-label {
    letter-spacing: 0.3px;
}

.spectator-switch {
    width: 28px;
    height: 16px;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    transition: background 0.2s ease;
}

.spectator-handle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.spectator-toggle.active {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.spectator-toggle.active .spectator-switch {
    background: #6366f1;
}

.spectator-toggle.active .spectator-handle {
    transform: translateX(12px);
}

.spectator-toggle:hover {
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.18);
}

.spectator-indicator {
    font-size: 14px;
    line-height: 1;
}

body.is-spectator .cards-container {
    opacity: 0.6;
    pointer-events: none;
}

.card-disabled {
    cursor: not-allowed !important;
    opacity: 0.45;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.participant-item.is-spectator {
    opacity: 0.8;
}

.participant-item.is-spectator .participant-name {
    color: #4b5563;
    font-style: italic;
}

.participant-vote.spectator {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border: 2px solid rgba(59, 130, 246, 0.25);
    font-size: 24px;
}

.participant-vote.vote-edited {
    position: relative;
}

.participant-vote.vote-edited .vote-edit-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.45);
    cursor: default;
}


.control-icon {
    width: 32px;
    height: 32px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.leave-icon {
    width: 20px;
    height: 20px;
}

.info-icon {
    width: 20px;
    height: 20px;
}

.control-icon:hover {
    transform: translateY(-2px);
}

.control-icon:active {
    transform: translateY(0);
}

.control-icon:focus {
    outline: 2px solid rgba(99, 102, 241, 0.6);
    outline-offset: 2px;
}
.board-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.board-title-icon {
    font-size: 30px;
    line-height: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.board-title {
    color: #667eea;
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

.admin-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.participant-item.is-me .participant-vote {
    border: 2px solid rgba(255, 193, 7, 0.95);
    box-shadow: 0 0 0 4px rgba(255, 226, 143, 0.4), 0 6px 18px rgba(230, 162, 13, 0.28);
    background: linear-gradient(180deg, rgba(255, 248, 220, 0.94), #ffffff);
}

.participant-item.is-me .participant-vote.pending {
    border: 2px solid rgba(255, 193, 7, 0.8);
    background: linear-gradient(180deg, rgba(255, 249, 230, 0.92), #ffffff);
}

.participant-item.is-me .participant-vote.spectator {
    border: 2px solid rgba(255, 193, 7, 0.8);
    background: linear-gradient(180deg, rgba(255, 249, 230, 0.92), rgba(255, 255, 255, 0.98));
    color: #b7791f;
}

.participant-item.is-me .participant-vote.voted,
.participant-item.is-me .participant-vote.revealed,
.participant-item.is-me .participant-vote.revealed-static {
    border: 2px solid rgba(255, 193, 7, 1);
    background: linear-gradient(175deg, rgba(255, 246, 210, 0.96), #ffffff);
    color: #667eea;
}

.admin-badge:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

.info-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-width: calc(100% - 40px);
    background: white;
    box-shadow: 0 18px 50px rgba(31, 41, 55, 0.22);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 20px;
    z-index: 11000;
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.info-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.info-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.info-panel-icon {
    font-size: 28px;
}

.info-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3666;
}

.info-panel-expiry {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.info-panel-expiry-detail {
    display: inline-block;
    margin-left: 4px;
    color: #9ca3af;
}

.info-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.info-panel-close:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #4c51bf;
}

.info-panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

#shareLink {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    background: #f9fafb;
    color: #374151;
}

.btn-copy-small {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.info-panel-section h4 {
    font-size: 14px;
    color: #374151;
    margin: 0 0 6px 0;
}

.info-panel-section p {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

.info-panel-section small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.info-panel-section ul {
    margin: 0;
    padding-left: 18px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.5;
}

.info-panel-section li {
    margin-bottom: 6px;
}

.info-panel-footer {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    letter-spacing: 0.3px;
}

.board-footer {
    margin-top: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    letter-spacing: 0.5px;
   
}

/* Reactions Bar */
.reactions-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.reaction-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex: 0 0 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reaction-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.reaction-btn:active {
    transform: scale(0.95);
}

/* Reactions Animation Container */
.reactions-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.flying-emoji {
    position: absolute;
    animation: flyUp 3s ease-out forwards;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.emoji-icon {
    font-size: 40px;
}

.emoji-name {
    font-size: 10px;
    font-weight: 600;
    color: #667eea;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes flyUp {
    0% {
        bottom: 0;
        opacity: 1;
        transform: translateY(0) rotate(var(--rotation-offset, 0deg)) scale(0.6);
    }
    15% {
        opacity: 1;
        transform: translateY(-80px) rotate(calc(var(--rotation-offset, 0deg) + 12deg)) scale(1.15);
    }
    40% {
        opacity: 1;
        transform: translateY(-250px) rotate(calc(var(--rotation-offset, 0deg) - 8deg)) scale(1.05);
    }
    70% {
        opacity: 0.8;
        transform: translateY(-450px) rotate(calc(var(--rotation-offset, 0deg) + 5deg)) scale(0.9);
    }
    90% {
        opacity: 0.3;
        transform: translateY(-580px) rotate(var(--rotation-offset, 0deg)) scale(0.5);
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateY(-650px) rotate(var(--rotation-offset, 0deg)) scale(0.3);
    }
}

.board-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.board-controls button {
    padding: 8px 15px;
    font-size: 12px;
    white-space: nowrap;
}

.expiration-info-header {
    color: #6c757d;
    font-size: 11px;
    font-weight: 400;
    cursor: help;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}



/* Highlight reveal button when all voted */
.btn-primary.ready-to-reveal {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    animation: pulseGreen 2s ease-in-out infinite;
}

.btn-primary.ready-to-reveal:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea87a 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(40, 167, 69, 0.5);
}

.btn-primary.btn-reset-confirm {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-primary.btn-reset-confirm:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea87a 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(40, 167, 69, 0.5);
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.8);
    }
}

.clickable-reveal {
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
}

.clickable-reveal:hover {
    color: #4c5fd5;
}

/* Section Titles */
.section-title {
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

/* Participants Section */
.participants-section {
    margin-bottom: 12px;
}

.participants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: center;
}

.participant-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: transparent;
    border-radius: 10px;
    min-width: 85px;
    box-shadow: none;
    transition: all 0.3s ease;
}


.participant-vote {
width: 60px;
height: 80px;
background: white;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: 700;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
transition: all 0.3s ease;
}

.participant-vote.voted {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}

.participant-vote.pending {
background: #f0f0f0;
color: #ccc;
}

.participant-vote.revealed {
background: white;
color: #667eea;
border: 2px solid #667eea;
}

.participant-vote.revealed-static {
background: white;
color: #667eea;
border: 2px solid #667eea;
}

.participant-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    max-width: 80px;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
}

.voting-closed-alert {
text-align: center;
color: #6c757d;
font-size: 14px;
font-weight: 500;
padding: 16px 20px;
margin-top: 15px;
background: #f8f9fa;
border-radius: 12px;
border: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    padding: 16px 20px;
    margin-top: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* Results Section */
.results-section {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    min-height: 44px;
}

.results-header .section-title {
    margin: 0;
}

.results-controls {
    display: flex;
    gap: 10px;
}

.results-content {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding-top: 4px;
}

.waiting-message {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    padding: 0 12px 2px 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.vote-count-text {
    white-space: nowrap;
}

.waiting-message small {
    display: block;
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-top: 4px;
}

#revealBtn {
    align-self: center;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Main stats row - horizontal layout */
.stats-main-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 6px;
    width: 100%;
}

.stat-box {
    flex: 1;
    max-width: 180px;
    text-align: center;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.stat-box-voted {
    max-width: 400px;
    flex: 2;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stat-label .voted-count {
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: white;
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.stat-box-voted {
    max-width: 400px;
    flex: 2;
}

.distribution-wrapper {
    margin-top: 8px;
}

.stat-distribution {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.dist-item {
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

.dist-value {
    font-weight: 700;
    color: #5c6bc0;
}

.dist-count {
    color: #6c757d;
    font-size: 11px;
    opacity: 0.8;
}

.distribution {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.results-content {
    min-height: 110px; /* More compact height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Modal */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.custom-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-modal-content h3 {
    color: #667eea;
    font-size: 24px;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.custom-modal-content p {
    color: #666;
    font-size: 16px;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.custom-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.custom-input:focus {
    outline: none;
    border-color: #667eea;
}

.custom-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.custom-modal-buttons button {
    min-width: 100px;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

@media (min-width: 1400px) {
    .cards-container {
        gap: 12px;
    }
}

@media (min-width: 1600px) {
    .cards-container {
        flex-wrap: nowrap;
        gap: 15px;
    }
}


.card {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    border: 2px solid #667eea;
    position: relative;
}

.card.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.3);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card.card-special {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.card.card-special:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.card.card-special.selected {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-header h1 {
        font-size: 22px;
    }
    
    .admin-header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .admin-header-actions a {
        width: 100%;
        text-align: center;
    }
    
    .boards-grid {
        grid-template-columns: 1fr;
    }
    
    #boardContainer {
        padding: 10px;
    }
    
    .board-main-container {
        padding: 20px;
    }
    
    .board-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .board-title-section {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .board-title-icon {
        font-size: 40px;
    }
    
    .board-title {
        font-size: 24px;
    }
    
    .admin-badge {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .expiration-info-header {
        font-size: 10px;
    }
    
    .board-controls {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .board-controls button {
        width: auto;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .participants-grid {
        gap: 10px;
        justify-content: center;
    }
    
    .participant-item {
        padding: 12px;
        min-width: 90px;
    }
    
    .participant-vote {
        width: 70px;
        height: 90px;
        font-size: 24px;
    }
    
    .card {
        width: 60px;
        height: 80px;
        font-size: 24px;
    }
    
    .cards-container {
        gap: 8px;
    }
    
    .reactions-bar {
        gap: 8px;
        padding: 15px;
        margin-top: 20px;
    }
    
    .reaction-btn {
        width: 45px;
        height: 45px;
        min-width: 45px;
        flex: 0 0 45px;
        font-size: 22px;
    }
    
    .emoji-icon {
        font-size: 36px;
    }
    
    .emoji-name {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    .results-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    
    .results-section {
        min-height: 164px;
    }
    
    
    .results-controls {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    #revealBtn {
        margin-bottom: 8px;
    }
    
    .stats-main-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-box {
        max-width: 100%;
        padding: 10px 14px;
    }
    
    .stat-label {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-voted {
        font-size: 22px;
    }
    
    .distribution {
        gap: 6px;
    }
    
    .dist-item {
        padding: 5px 10px;
    }
    
    .dist-value {
        font-size: 14px;
    }
    
    .dist-count {
        font-size: 12px;
    }
    
    .waiting-message {
        font-size: 14px;
        padding: 6px;
    }
    
    .waiting-message small {
        font-size: 12px;
        margin-top: 6px;
    }
    
    .results-content {
        min-height: 70px;
    }
    
    .results-section {
        padding: 10px 14px;
    }
    
    .voting-closed-alert {
        font-size: 13px;
        padding: 14px 16px;
    }
    
    .custom-modal-content {
        padding: 25px;
        width: 95%;
    }
    
    .custom-modal-content h3 {
        font-size: 20px;
    }
}

/* Admin Dashboard Header Actions */
.admin-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-header-actions a {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-header-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.admin-header-actions .btn-secondary:hover {
    background: #5a6268;
}

.admin-header-actions .btn-change-password {
    background: #007bff;
    color: white;
}

.admin-header-actions .btn-change-password:hover {
    background: #0056b3;
}

.admin-header-actions .btn-cleanup {
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
}

.admin-header-actions .btn-cleanup:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}
