* {
    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-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Removed - no longer needed since main is not using container class */

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 0;
    position: relative;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.admin-badge {
    background-color: #e74c3c;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    background-color: white;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
}

/* Removed - handled by main-wrapper class */

/* Wrapper to maintain container width inside main */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* Ensure content alignment across all pages */
.content-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

/* Polls Grid */
.polls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.poll-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: box-shadow 0.3s;
    position: relative;
    overflow: hidden; /* Ensure badges stay within card boundaries */
    z-index: 1; /* Create proper stacking context */
}

.poll-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.poll-card h3 {
    margin-bottom: 0.5rem;
}

.poll-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.poll-card h3 a:hover {
    color: #3498db;
}

/* Poll Header styling to contain badges */
.poll-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 1rem;
    min-height: 2rem; /* Ensure minimum height for badges */
}

.poll-header h3 {
    margin: 0;
    flex: 1;
    min-width: 0; /* Allow text truncation if needed */
}

.poll-description {
    color: #666;
    margin-bottom: 1rem;
}

.poll-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #666;
}

/* Poll View */
.poll-view h1 {
    margin-bottom: 1rem;
}

.poll-options {
    margin: 2rem 0;
}

.option {
    margin-bottom: 1rem;
}

.option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.option label:hover {
    background-color: #e9ecef;
}

.option input[type="radio"] {
    width: auto;
    margin-right: 1rem;
}

/* Poll Results */
.option-result {
    margin-bottom: 1.5rem;
}

.option-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.option-bar {
    background-color: #e9ecef;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.option-fill {
    background-color: #3498db;
    height: 100%;
    transition: width 0.5s ease;
}

.option-count {
    font-size: 0.875rem;
    color: #666;
}

/* Profile */
.profile-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.polls-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.poll-item {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.poll-item h4 {
    margin-bottom: 0.5rem;
}

.poll-item h4 a {
    color: #2c3e50;
    text-decoration: none;
}

/* Create Poll */
#options-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#options-container input {
    width: 100%;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .polls-grid {
        grid-template-columns: 1fr;
    }
    
    /* Adjust poll header for mobile */
    .poll-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .poll-badges {
        width: 100%; /* Full width on mobile */
        justify-content: flex-start;
        overflow-x: auto; /* Allow horizontal scroll if needed */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .poll-badges .action-badge,
    .poll-badges .category-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
        flex-shrink: 0; /* Prevent badge shrinking on mobile */
    }
}

/* About Page Styles */
.about-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.about-page h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2.5rem;
}

.about-page h2 {
    color: #34495e;
    margin-bottom: 1rem;
    text-align: center;
}

.about-page h3 {
    color: #2c3e50;
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
    text-align: center;
}

/* Center content blocks with constrained width */
.about-page p,
.about-page > ul,
.about-page > ol {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.intro-section {
    max-width: 900px;
    margin: 0 auto 3rem auto;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.intro-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
}

.vision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 2rem auto;
}

.vision-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.vision-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.vision-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.how-section {
    max-width: 850px;
    margin: 2rem auto;
}

.how-section ol {
    margin-left: 2rem;
    line-height: 2;
}

.how-section li {
    margin-bottom: 0.8rem;
}

.funding-section {
    max-width: 850px;
    background: #e8f4f8;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem auto;
}

.funding-section h3 {
    margin-top: 0;
}

.funding-section ul {
    margin-left: 2rem;
    line-height: 2;
}

/* Comparison container - two column layout */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 900px;
    margin: 2rem auto;
}

.comparison-column {
    padding: 2rem;
    border-radius: 8px;
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comparison-column.traditional {
    background: #fee5e5;
    border: 1px solid #fcc;
}

.comparison-column.odc {
    background: #e5f7e5;
    border: 1px solid #cfc;
}

.comparison-column h4 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    text-align: center;
}

.comparison-column.traditional h4 {
    color: #c33;
}

.comparison-column.odc h4 {
    color: #2a7f2a;
}

.comparison-column ul {
    list-style: none;
    padding: 0;
}

.comparison-column li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    line-height: 1.6;
}

.comparison-column li:last-child {
    border-bottom: none;
}

.comparison-column.traditional li::before {
    content: "✗ ";
    color: #c33;
    font-weight: bold;
    margin-right: 0.5rem;
}

.comparison-column.odc li::before {
    content: "✓ ";
    color: #2a7f2a;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Responsive - stack columns on mobile */
@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .comparison-column {
        padding: 1.5rem;
    }
}

/* OLD TABLE STYLES - COMMENTED OUT
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    width: 45%;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
    width: 55%;
}

.comparison-table th {
    background: #2c3e50;
    color: white;
    font-weight: bold;
}

.comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}
*/

.join-section {
    text-align: center;
    max-width: 850px;
    margin: 3rem auto 0 auto;
    padding: 2rem;
    background: #e8f4f8;
    border-radius: 8px;
}

.cta-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background: #2980b9;
}

/* Responsive About Page */
@media (max-width: 768px) {
    .about-page {
        padding: 1rem;
    }
    
    .about-page h1 {
        font-size: 2rem;
    }
    
    .vision-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Poll Badges - Standardized for proper alignment */
.poll-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap; /* Prevent wrapping to keep badges on same line */
    align-items: center; /* Ensures vertical center alignment */
    justify-content: flex-start; /* Align badges to the left */
    flex-shrink: 0; /* Prevent badges from shrinking */
    min-width: max-content; /* Ensure badges have enough space */
}

.poll-badges .action-badge,
.poll-badges .category-badge {
    /* Standardized dimensions for both badge types */
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Center content within badge */
    line-height: 1.2;
    min-height: 24px; /* Ensure consistent height */
    height: 24px; /* Fixed height for perfect alignment */
    position: relative; /* Keep badges in normal flow */
    vertical-align: middle; /* Additional vertical alignment */
}

.poll-badges .action-badge {
    background: #28a745;
    color: white;
    font-weight: 600;
    order: -1; /* Ensure action badge always appears first */
}

/* Category badge colors */
.category-badge {
    text-transform: capitalize;
}

.category-general { background: #e9ecef; color: #495057; }
.category-budget { background: #d4edda; color: #155724; }
.category-rules { background: #d1ecf1; color: #0c5460; }
.category-partnerships { background: #f8d7da; color: #721c24; }
.category-wellbeing { background: #fff3cd; color: #856404; }
.category-platform { background: #e2e3e5; color: #383d41; }
.category-governance { background: #d6d8db; color: #383d41; }