:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #f3f4f6;
    --secondary-dark: #e5e7eb;
    --text: #111827;
    --text-light: #6b7280;
    --danger: #ef4444;
    --success: #10b981;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --radius: 0.375rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background-color: #f9fafb;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-light);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

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

.btn.primary:hover {
    background-color: var(--primary-dark);
}

.btn.secondary {
    background-color: var(--secondary);
    color: var(--text);
}

.btn.secondary:hover {
    background-color: var(--secondary-dark);
}

.btn i {
    margin-right: 0.5rem;
}

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

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

input, textarea, select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

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

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.visible {
    display: block;
}

input.error, textarea.error {
    border-color: var(--danger);
}

hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* Poll Types */
.poll-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.poll-type-card {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.poll-type-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.poll-type-card .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    margin-right: 1rem;
    color: var(--primary);
}

.poll-type-card .content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.poll-type-card .content p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 1rem -0.5rem;
    display: inline-flex;
    align-items: center;
}

.back-btn:hover {
    color: var(--text);
}

.back-btn i {
    margin-right: 0.25rem;
}

/* Poll Options */
.poll-options-section {
    margin-bottom: 1.5rem;
}

.poll-options-section h3 {
    margin-bottom: 1rem;
}

.option-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: white;
}

.option-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: end;
}

.option-row:last-child {
    margin-bottom: 0;
}

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

.remove-option {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    height: 38px;
    width: 38px;
}

.remove-option:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.empty-state i {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Poll Cards */
.poll-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: white;
    margin-bottom: 1rem;
    overflow: hidden;
}

.poll-card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.poll-card-type {
    display: inline-flex;
    align-items: center;
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.poll-card-type i {
    margin-right: 0.25rem;
}

.poll-card-title {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.poll-card-description {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.poll-card-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

.delete-poll {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.delete-poll:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.poll-card-content {
    padding: 1rem;
}

.poll-card-options {
    margin-top: 0.5rem;
}

.poll-option {
    padding: 0.75rem;
    background-color: var(--secondary);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.poll-option-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Voting Styles */
.voting-option {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
    overflow: hidden;
}

.voting-option:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.voting-option.selected {
    border-color: var(--primary);
    background-color: rgba(79, 70, 229, 0.05);
}

.voting-option-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
}

.voting-option-text {
    flex: 1;
}

.voting-option-stats {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-left: 1rem;
}

.vote-count {
    display: block;
    margin-bottom: 0.25rem;
}

.vote-percentage {
    font-weight: 600;
    color: var(--primary);
}

.voting-option-bar {
    height: 4px;
    background-color: var(--secondary);
}

.voting-option-progress {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.voted-indicator {
    display: inline-flex;
    align-items: center;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    margin-top: 0.5rem;
}

.voted-indicator i {
    margin-right: 0.25rem;
}

.poll-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.poll-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.poll-option-stats {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.vote-bar {
    width: 100%;
    height: 4px;
    background-color: var(--secondary);
    border-radius: 2px;
    margin-top: 0.25rem;
    overflow: hidden;
}

.vote-progress {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 350px;
    max-width: calc(100% - 2rem);
    overflow: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.hidden {
    transform: translateY(100%);
    opacity: 0;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.toast-icon {
    color: var(--success);
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.toast-message {
    flex: 1;
}

.toast-title {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.toast-description {
    font-size: 0.875rem;
    color: var(--text-light);
}

.toast-progress {
    height: 3px;
    background-color: var(--success);
    width: 100%;
    animation: toast-progress 3s linear forwards;
}

@keyframes toast-progress {
    0% { width: 100%; }
    100% { width: 0%; }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.close-modal:hover {
    background-color: var(--secondary);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.response-summary {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--secondary);
    border-radius: var(--radius);
}

.response-summary h4 {
    margin-bottom: 0.5rem;
}

.response-summary p {
    margin-bottom: 0.25rem;
}

.response-details h4 {
    margin-bottom: 1rem;
}

.response-option {
    margin-bottom: 1rem;
}

.response-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.response-option-name {
    font-weight: 500;
}

.response-option-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.response-option-bar {
    width: 100%;
    height: 8px;
    background-color: var(--secondary);
    border-radius: 4px;
    overflow: hidden;
}

.response-option-progress {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.dietary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.dietary-tag {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background-color: var(--secondary);
    color: var(--text);
}

.dietary-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dietary-checkbox {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    cursor: pointer;
}

.dietary-checkbox input {
    width: auto;
    margin-right: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .poll-types {
        grid-template-columns: 1fr;
    }
    
    .option-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .voting-option-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .voting-option-stats {
        text-align: left;
        margin-left: 0;
    }
    
    .poll-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid var(--border);
        border-right: none;
    }
    
    .tab-btn.active {
        border-bottom-color: var(--primary);
    }
}