/* All existing CSS remains the same */
:root {
    --primary: #3a86ff;
    --light: #f8f9fa;
    --dark: #212529;
    --border: #e0e0e0;
    --background: #ffffff;
    --card-bg: #fafafa;
    --normal: #06d6a0;
    --long-term: #3a86ff;
    --critical: #ff006e;
    --poll: #8b5cf6;
    --todo: #3a86ff;
    --in-progress: #ffbe0b;
    --completed: #06d6a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--dark);
    line-height: 1.5;
    padding: 0;
}

.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    background-color: var(--background);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    gap: 15px;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    width: 150px;
    flex-shrink: 0;
}

.menu-controls {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.menu-section {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary);
}

.btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    background: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    justify-content: center;
    white-space: nowrap;
}

.btn:hover {
    background: #f5f5f5;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #2a75f0;
}

.btn-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    min-width: 140px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	grid-auto-rows: min-content;
	align-items: start;
    gap: 12px;
}

.task-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    height: auto;
	min-height: 105px;
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.task-card.todo {
    border-left: 4px solid var(--todo);
}

.task-card.in-progress {
    border-left: 4px solid var(--in-progress);
}

.task-card.completed {
    border-left: 4px solid var(--completed);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.task-title {
    font-weight: 600;
    font-size: 1rem;
    margin-right: 10px;
    color: var(--dark);
    flex: 1;
}

.task-type {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.type-normal {
    background-color: rgba(6, 214, 160, 0.1);
    color: var(--normal);
}

.type-long-term {
    background-color: rgba(58, 134, 255, 0.1);
    color: var(--long-term);
}

.type-critical {
    background-color: rgba(255, 0, 110, 0.1);
    color: var(--critical);
}

.type-poll {
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--poll);
}

.task-details {
    color: #555;
    font-size: 0.85rem;
    flex: 1;
    overflow: hidden;
    margin-bottom: 4px;
    line-height: 1.3;
}

.task-details-content {
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.poll-info {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
    text-align: center;
    padding: 4px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 4px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
	margin-bottom: 4px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.assigned-user {
    font-size: 0.75rem;
    color: #555;
}

.task-status {
    font-weight: 600;
    font-size: 0.75rem;
}

.task-status.todo {
    color: var(--todo);
}

.task-status.in-progress {
    color: var(--in-progress);
}

.task-status.completed {
    color: var(--completed);
}

.task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    
}

.task-actions button {
    flex: 1;
    padding: 4px;
    font-size: 0.65rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e9ecef;
    color: #555;
}

.task-actions button:hover {
    background: #dee2e6;
}

.view-task {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.view-task:hover {
    background: #2a75f0;
}

.vote-task {
    background: var(--poll);
    color: white;
    border-color: var(--poll);
}

.vote-task:hover {
    background: #7c3aed;
}

.fab-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #2a75f0);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.fab-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(58, 134, 255, 0.4);
}

.fab-btn:active {
    transform: translateY(0) scale(0.98);
}

.fab-btn::after {
    content: 'Add Task';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.fab-btn:hover::after {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 1000px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.task-form {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

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

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    min-height: 200px;
    resize: vertical;
}

.poll-option-input {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.poll-option-input input {
    flex: 1;
}

.remove-option {
    background: var(--critical);
    color: white;
    border: none;
    border-radius: 4px;
    width: 35px;
    cursor: pointer;
}

.add-option {
    background: var(--poll);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
}

.btn-cancel {
    background: white;
    color: #555;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-delete {
    background: var(--critical);
    color: white;
    border-color: var(--critical);
}

.btn-delete:hover {
    background: #d90429;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #777;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #555;
}

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

.stat-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
}

@media (max-width: 768px) {
    .top-menu {
        flex-direction: column;
        gap: 12px;
    }

    .menu-controls {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .menu-section {
        width: 100%;
        justify-content: space-between;
    }

    .btn, select {
        min-width: auto;
        flex: 1;
    }

    .tasks-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    /* Modal responsive styles */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .task-view-content {
        flex-direction: column;
    }

    .task-details-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .comments-section {
        max-width: 100%;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .stat-item {
        flex: 1 1 45%;
        min-width: 120px;
    }
}

.status-filters {
    display: flex;
    gap: 8px;
}

.status-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    background: white;
    transition: all 0.2s ease;
    width: auto;
    text-align: center;
    white-space: nowrap;
}

.status-filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.project-plan-btn {
    background: #5dade2;
    color: white;
    border-color: #5dade2;
}

.project-plan-btn:hover {
    background: #3498db;
    border-color: #3498db;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: 5px;
}

.close-mobile-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--dark);
    padding: 0;
    line-height: 1;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1000;
    padding: 20px;
    flex-direction: column;
    gap: 15px;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-section h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 5px;
}

.view-modal .modal-content {
    max-width: 1000px;
}

.task-view-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.task-details-section {
    flex: 1;
    padding: 20px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.task-details-view {
    line-height: 1.6;
    font-size: 1rem;
    color: #555;
    overflow-wrap: break-word;
}

.task-meta-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.meta-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.meta-label {
    font-weight: 600;
    color: #333;
}

.meta-value {
    color: #666;
}

.comments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 400px;
}

.comments-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: #f8f9fa;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.comment-item {
    padding: 12px;
    margin-bottom: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
}

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

.comment-user {
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-timestamp {
    font-size: 0.75rem;
    color: #888;
}

.comment-text {
    color: #555;
    line-height: 1.4;
}

.add-comment-section {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: #f8f9fa;
}

.comment-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
    font-family: inherit;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.view-modal .task-meta-view {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid var(--border);
    background: #f8f9fa;
    flex-shrink: 0;
}

.view-modal .task-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-modal .task-meta-label {
    font-weight: 600;
    color: #333;
}

.view-modal .task-meta-value {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.vote-modal .modal-content {
    max-width: 500px;
}

.vote-options {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.vote-option {
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    position: relative;
    overflow: hidden;
}

.vote-option:hover {
    border-color: var(--poll);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.vote-option.selected {
    border-color: var(--poll);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.vote-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.vote-option.selected .vote-option-radio {
    border-color: var(--poll);
    background: var(--poll);
}

.vote-option.selected .vote-option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.vote-option-text {
    font-weight: 500;
    font-size: 1rem;
    flex: 1;
}

.vote-option-check {
    color: var(--poll);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vote-option.selected .vote-option-check {
    opacity: 1;
}

.vote-results {
    padding: 20px;
}

.vote-result {
    margin-bottom: 8px;
}

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

.vote-result-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.vote-result-fill {
    height: 100%;
    background: var(--poll);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.user-vote {
    color: var(--poll);
    font-weight: 600;
}

.login-modal .modal-content {
    max-width: 450px;
}

.login-form {
    padding: 30px;
}

.compact-form-row {
    display: flex;
    gap: 15px;
    margin-top: auto;
    align-items: flex-end;
}

.compact-form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-controls-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex: 2;
}

.form-buttons-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.poll-view-modal .modal-content {
    max-width: 700px;
}

.poll-results {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.poll-option-result {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.poll-option-header {
    padding: 12px 15px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.poll-option-text {
    font-weight: 600;
    flex: 1;
}

.poll-option-votes {
    color: var(--poll);
    font-weight: 600;
    margin-left: 10px;
}

.poll-voters-list {
    padding: 15px;
    background: white;
}

.voter-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.voter-item:last-child {
    border-bottom: none;
}

.voter-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.voter-name {
    font-weight: 500;
}

.poll-summary {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    flex-shrink: 0;
}

.total-votes {
    color: var(--poll);
}

.sort-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: #f5f5f5;
}

.sort-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
}

/* Poll Results Display Styles */
.poll-summary-view {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.poll-stats {
    display: flex;
    gap: 15px;
    font-size: 0.95rem;
    color: #666;
}

.poll-results-inline {
    /* Compact list container for poll results */
}

.poll-results-inline .poll-result {
    margin-bottom: 8px;
}

.poll-results-inline .vote-result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.poll-results-inline .vote-result-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.poll-results-inline .vote-result-fill {
    height: 100%;
    background: var(--poll);
    border-radius: 3px;
    transition: width 0.3s ease;
}