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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    color: #333;
    font-size: 1.5rem;
    margin: 20px 0 15px;
}

h3 {
    color: #555;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

h4 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-style: italic;
}

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

.form-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

.participant-row,
.agenda-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.participant-row input {
    flex: 1;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
    margin-top: 20px;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-top: 10px;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #c82333;
}

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

.btn-normalize:hover {
    background: #218838;
    transform: translateY(-2px);
}

.success-box {
    background: #d4edda;
    border: 2px solid #28a745;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
}

.success-message {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.error-box {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.url-section {
    margin: 25px 0;
}

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

.url-display input {
    flex: 1;
    font-family: monospace;
    background: #f8f9fa;
}

.participant-link {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.meeting-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.participant-name {
    color: #666;
    margin-top: 10px;
}

.vote-instructions {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.role-legend {
    margin-top: 15px;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.role-weight {
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
}

.role-label {
    color: #555;
}

.vote-item {
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.radio-group {
    margin-top: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.radio-label:hover {
    background: #e9ecef;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #667eea;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    background: #667eea;
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

.radio-text {
    flex: 1;
}

.radio-text strong {
    color: #667eea;
    margin-right: 8px;
}

/* Display page styles */
.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.display-grid {
    overflow-x: auto;
    margin: 20px 0;
}

.display-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.display-table th {
    background: #667eea;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.display-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #ddd;
}

.display-table tr:hover {
    background: #f8f9fa;
}

.display-table tr.overweight {
    background: #fff3cd;
}

.display-table tr.overweight:hover {
    background: #ffe69c;
}

.participant-cell {
    font-weight: 600;
    white-space: nowrap;
}

.warning-icon {
    margin-left: 5px;
}

.weight-cell {
    text-align: center;
}

.total-column {
    background: #5568d3 !important;
}

.total-cell {
    text-align: center;
    font-size: 16px;
    background: #f8f9fa;
}

.weight-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}

.weight-full {
    background: #28a745;
    color: white;
}

.weight-half {
    background: #ffc107;
    color: #333;
}

.weight-none {
    background: #6c757d;
    color: white;
}

.display-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.auto-refresh {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover:not(:disabled) {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.tab-content {
    display: none;
    margin-top: 20px;
}

.tab-content.active {
    display: block;
}

/* Voting UI */
.vote-status {
    text-align: center;
    padding: 40px 20px;
}

.no-vote {
    font-size: 1.2rem;
    color: #999;
    font-style: italic;
}

.active-vote {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.vote-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 15px 0;
}

.vote-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.vote-timer {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 20px;
}

.vote-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.btn-vote {
    flex: 1;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-yes {
    background: #28a745;
    color: white;
}

.btn-yes:hover {
    background: #218838;
    transform: scale(1.05);
}

.btn-no {
    background: #dc3545;
    color: white;
}

.btn-no:hover {
    background: #c82333;
    transform: scale(1.05);
}

.vote-submitted {
    text-align: center;
    padding: 20px;
    background: #d4edda;
    border-radius: 6px;
    margin-top: 20px;
}

.vote-submitted p {
    margin: 5px 0;
    color: #155724;
    font-weight: 600;
}

/* Results */
.results-summary {
    margin: 20px 0;
}

.result-bar {
    margin: 20px 0;
}

.result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.result-progress {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 8px;
}

.result-progress-bar {
    height: 100%;
    transition: width 0.5s;
}

.result-yes {
    background: #28a745;
}

.result-no {
    background: #dc3545;
}

.result-count {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
}

/* Display page voting */
.display-vote-box {
    background: #fff3cd;
    border: 3px solid #ffc107;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
}

.display-vote-box h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.timer-large {
    font-size: 1.5rem;
    color: #667eea;
    text-align: center;
    margin: 20px 0;
}

.live-tally {
    margin-top: 30px;
}

.live-tally h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.tally-summary {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.tally-item {
    flex: 1;
    max-width: 200px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.tally-yes {
    background: #d4edda;
    border: 2px solid #28a745;
}

.tally-no {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.tally-label {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.tally-yes .tally-label {
    color: #28a745;
}

.tally-no .tally-label {
    color: #dc3545;
}

.tally-count {
    font-size: 1.2rem;
    margin: 5px 0;
}

.tally-weight {
    font-size: 0.9rem;
    color: #666;
}

.tally-responses {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.tally-responses h4 {
    margin-bottom: 15px;
}

.tally-responses ul {
    list-style: none;
    padding: 0;
}

.tally-responses li {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 4px;
}

.response-yes {
    background: #d4edda;
    color: #155724;
}

.response-no {
    background: #f8d7da;
    color: #721c24;
}

.display-results-box {
    background: #667eea;
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin: 20px 0;
}

.display-results-box h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.display-results-box h3 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
}

.final-results-summary {
    margin: 30px 0;
}

.final-result-bar {
    margin: 20px 0;
}

.final-result-label {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: white;
}

.final-result-progress {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.final-result-progress-bar {
    height: 100%;
    transition: width 0.5s;
}

.final-result-yes {
    background: #28a745;
}

.final-result-no {
    background: #dc3545;
}

.final-result-count {
    color: white;
    font-size: 1rem;
}

.display-results-box .btn {
    background: white;
    color: #667eea;
    width: 100%;
    margin-top: 20px;
}

.display-results-box .btn:hover {
    background: #f8f9fa;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container,
    .container-wide {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .participant-row,
    .agenda-row {
        flex-direction: column;
        gap: 8px;
    }

    .btn-remove {
        width: 100%;
    }

    .display-header {
        flex-direction: column;
        align-items: stretch;
    }

    .display-header h1 {
        font-size: 1.5rem;
    }

    .display-table {
        font-size: 12px;
    }

    .display-table th,
    .display-table td {
        padding: 8px 4px;
    }

    .legend {
        flex-direction: column;
        gap: 10px;
    }

    .vote-buttons {
        flex-direction: column;
    }

    .btn-vote {
        font-size: 1rem;
    }

    .tally-summary {
        flex-direction: column;
    }

    .tally-item {
        max-width: 100%;
    }

    .tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    .url-display {
        flex-direction: column;
    }

    .display-table th,
    .display-table td {
        font-size: 11px;
        padding: 6px 3px;
    }

    .vote-question {
        font-size: 1.2rem;
    }

    .display-vote-box h2 {
        font-size: 1.5rem;
    }

    .display-vote-box,
    .display-results-box {
        padding: 20px;
    }
}

/* Agenda Voting Styles */
.voting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.agenda-vote-item {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.agenda-vote-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agenda-item-locked {
    background: #f8f9fa;
    border-color: #999;
    opacity: 0.8;
}

.agenda-vote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.locked-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: bold;
}

.locked-yes {
    background: #28a745;
    color: white;
}

.locked-no {
    background: #dc3545;
    color: white;
}

.vote-tally {
    margin: 15px 0;
}

.tally-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.tally-label {
    font-weight: bold;
    min-width: 60px;
    font-size: 0.95rem;
}

.tally-yes-row .tally-label {
    color: #28a745;
}

.tally-no-row .tally-label {
    color: #dc3545;
}

.tally-abstain-row .tally-label {
    color: #6c757d;
}

.tally-bar {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.tally-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.tally-bar-yes {
    background: #28a745;
}

.tally-bar-no {
    background: #dc3545;
}

.tally-stats {
    font-size: 0.85rem;
    color: #666;
    min-width: 200px;
    text-align: right;
}

.vote-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-vote-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-vote-yes {
    border-color: #28a745;
    color: #28a745;
}

.btn-vote-yes:hover {
    background: #28a745;
    color: white;
}

.btn-vote-yes.active {
    background: #28a745;
    color: white;
}

.btn-vote-no {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-vote-no:hover {
    background: #dc3545;
    color: white;
}

.btn-vote-no.active {
    background: #dc3545;
    color: white;
}

.btn-vote-abstain {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-vote-abstain:hover {
    background: #6c757d;
    color: white;
}

.btn-vote-abstain.active {
    background: #6c757d;
    color: white;
}

.my-vote-indicator {
    text-align: center;
    margin-top: 10px;
    color: #667eea;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.no-items {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Display Screen Agenda Voting */
.display-section {
    margin: 30px 0;
}

.display-agenda-item {
    background: #f8f9fa;
    border: 3px solid #667eea;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.display-item-locked {
    border-color: #999;
    background: #e9ecef;
}

.display-agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.display-agenda-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.display-locked-badge {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

.display-locked-yes {
    background: #28a745;
    color: white;
}

.display-locked-no {
    background: #dc3545;
    color: white;
}

.display-vote-bars {
    margin: 20px 0;
}

.display-bar-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.display-bar-label {
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 60px;
}

.display-bar-container {
    flex: 1;
    height: 35px;
    background: #e9ecef;
    border-radius: 18px;
    overflow: hidden;
}

.display-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.display-bar-yes {
    background: #28a745;
}

.display-bar-no {
    background: #dc3545;
}

.display-bar-stats {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    min-width: 80px;
    text-align: right;
}

.display-vote-counts {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.vote-count {
    padding: 8px 16px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.95rem;
}

.vote-count-yes {
    background: #d4edda;
    color: #155724;
}

.vote-count-no {
    background: #f8d7da;
    color: #721c24;
}

.vote-count-abstain {
    background: #e9ecef;
    color: #495057;
}

@media (max-width: 768px) {
    .vote-buttons-row {
        flex-direction: column;
    }

    .display-bar-row {
        flex-wrap: wrap;
    }

    .display-bar-label,
    .display-bar-stats {
        min-width: auto;
    }

    .display-vote-counts {
        flex-direction: column;
        align-items: center;
    }

    .tally-stats {
        min-width: auto;
        font-size: 0.75rem;
    }

    .tally-row {
        flex-wrap: wrap;
    }
}
