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

/* CSS Variables for Theme System */
:root {
    /* Light Theme (Default) */
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-inverse: #ffffff;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --header-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --modal-backdrop: rgba(0, 0, 0, 0.5);
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --primary: #007bff;
    --secondary: #6c757d;
}

/* Dark Theme - Neon Cyberpunk */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #131318;
    --bg-tertiary: #1a1a20;
    --text-primary: #e0e6ff;
    --text-secondary: #9ca3af;
    --text-inverse: #ffffff;
    --border-color: #2d3748;
    --shadow: rgba(0, 255, 255, 0.1);
    --shadow-hover: rgba(0, 255, 255, 0.2);
    --header-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    --modal-backdrop: rgba(0, 0, 0, 0.9);
    --input-bg: #1a1a20;
    --input-border: #2d3748;
    --success: #00ff88;
    --danger: #ff3366;
    --warning: #ffaa00;
    --info: #00ccff;
    --primary: #00ffff;
    --secondary: #6366f1;
    
    /* Neon Colors */
    --neon-cyan: #00ffff;
    --neon-pink: #ff00ff;
    --neon-green: #00ff88;
    --neon-purple: #8b5cf6;
    --neon-orange: #ff8800;
    --neon-blue: #0099ff;
    
    /* Glow Effects */
    --glow-cyan: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 15px #00ffff;
    --glow-pink: 0 0 5px #ff00ff, 0 0 10px #ff00ff, 0 0 15px #ff00ff;
    --glow-green: 0 0 5px #00ff88, 0 0 10px #00ff88, 0 0 15px #00ff88;
    --glow-purple: 0 0 5px #8b5cf6, 0 0 10px #8b5cf6, 0 0 15px #8b5cf6;
}

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
    background: var(--header-gradient);
    color: var(--text-inverse);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
}

/* Dark mode neon effects for header */
[data-theme="dark"] .header {
    border-bottom: 1px solid var(--neon-cyan);
    box-shadow: 0 2px 20px rgba(0, 255, 255, 0.3), 
                0 0 50px rgba(0, 255, 255, 0.1);
}

[data-theme="dark"] .header h1 {
    color: var(--neon-cyan);
    font-weight: 700;
}

[data-theme="dark"] .header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.1) 0%, 
        rgba(138, 92, 246, 0.1) 50%, 
        rgba(255, 0, 255, 0.1) 100%);
    pointer-events: none;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Theme Toggle Styles */
.theme-toggle {
    margin-right: 0.5rem;
}

.btn-theme {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.7rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.btn-theme:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-theme i {
    font-size: 1rem;
}

/* Dark mode neon theme toggle */
[data-theme="dark"] .btn-theme {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

[data-theme="dark"] .btn-theme:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 8px var(--neon-cyan);
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: white;
    font-weight: 500;
}

.board-select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 200px;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3742fa;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2f32e2;
}

.btn-success {
    background: #2ed573;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #1fc55e;
}

.btn-secondary {
    background: #57606f;
    color: white;
}

.btn-secondary:hover {
    background: #485056;
}

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

.btn-danger:hover {
    background: #e62e2e;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.main-content {
    padding: 2rem;
    max-width: 100%;
    overflow-x: auto;
}

.kanban-board {
    display: flex;
    gap: 1.5rem;
    min-height: calc(100vh - 140px);
    padding-bottom: 2rem;
}

.column {
    flex: 1;
    min-width: 300px;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.person-count {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.column-content {
    flex: 1;
    padding: 1rem;
    min-height: 200px;
}

.person-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.person-card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-1px);
}

.person-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.person-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.person-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.weak-tag {
    background: #e8f5e8;
    color: #2e7d2e;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Dark mode neon tag styles */
[data-theme="dark"] .tag {
    background: rgba(0, 153, 255, 0.15);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 153, 255, 0.3);
}

[data-theme="dark"] .tag:hover {
    background: rgba(0, 153, 255, 0.25);
    box-shadow: 0 0 15px rgba(0, 153, 255, 0.5);
    transform: scale(1.05);
}

[data-theme="dark"] .weak-tag {
    background: rgba(0, 255, 136, 0.15);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

[data-theme="dark"] .weak-tag:hover {
    background: rgba(0, 255, 136, 0.25);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
    transform: scale(1.05);
}

.person-attachment-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ff9800;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-backdrop);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 2% auto;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

.modal-content.large {
    max-width: 800px;
}

.modal-content.extra-large {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    max-height: 800px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.extra-large .overview-controls {
    flex: 1;
    overflow: hidden;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 1rem;
    top: 1rem;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3742fa;
    box-shadow: 0 0 0 0.2rem rgba(55, 66, 250, 0.25);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.tags-container {
    border: 1px solid var(--input-border);
    border-radius: 0.375rem;
    padding: 0.5rem;
    background: var(--input-bg);
    min-height: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag-pill {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.weak-tag-pill {
    background: #e8f5e8;
    color: #2e7d2e;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-pill .remove-tag,
.weak-tag-pill .remove-tag {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color 0.2s;
}

.tag-pill .remove-tag:hover {
    background: #1976d2;
    color: white;
}

.weak-tag-pill .remove-tag:hover {
    background: #2e7d2e;
    color: white;
}

.tag-input-container {
    position: relative;
    flex: 1;
}

.tag-input-container input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.tag-suggestions,
.field-suggestions {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px var(--shadow-hover);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    width: 100%;
    top: 100%;
    left: 0;
}

.tag-suggestion,
.field-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.tag-suggestion:last-child,
.field-suggestion:last-child {
    border-bottom: none;
}

.tag-suggestion:hover,
.field-suggestion:hover,
.tag-suggestion.highlighted,
.field-suggestion.highlighted {
    background: var(--bg-tertiary);
}

.tag-suggestion strong,
.field-suggestion strong {
    color: var(--text-primary);
}

.tag-suggestion small,
.field-suggestion small {
    color: var(--text-secondary);
    font-weight: normal;
}

.attachment-list {
    margin-top: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.attachment-link:hover {
    color: var(--primary);
    text-decoration: underline;
    opacity: 0.8;
}

.custom-fields {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    background: var(--bg-tertiary);
}

.custom-field {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.custom-field .field-name-container {
    flex: 1;
    position: relative;
}

.custom-field input {
    flex: 1;
    width: 100%;
}

.custom-field .field-value {
    flex: 1;
}

.custom-field button {
    padding: 0.25rem 0.5rem;
}

.field-name-container {
    position: relative;
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.comment {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.comment-content {
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.comment-input {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.comment-input textarea {
    flex: 1;
    min-height: 60px;
}

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

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

.column-content.drag-over {
    background-color: var(--bg-tertiary);
    border: 2px dashed var(--primary);
    opacity: 0.8;
}

/* People Overview Styles */
.overview-controls {
    display: flex;
    gap: 2rem;
    height: 500px;
}

.filter-section {
    flex: 1;
    max-width: 300px;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
}

.results-section {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.pagination-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
}

.pagination-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-text {
    font-weight: 500;
    color: var(--text-primary);
}

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

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pagination-controls .btn {
    min-width: 80px;
}

.pagination-controls .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filters-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.filter-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    flex-wrap: wrap;
}

.filter-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.filter-type {
    min-width: 100px;
}

.filter-value {
    flex: 1;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.saved-filters-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.saved-filters-section h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.saved-filters-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.saved-filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.saved-filter-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.saved-filter-name {
    cursor: pointer;
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    user-select: none;
}

.saved-filter-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.btn-small {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.no-saved-filters {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
    padding: 0.5rem;
    text-align: center;
}

.people-results {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.person-result-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-secondary);
    box-shadow: 0 2px 4px var(--shadow);
}

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

.person-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.person-board {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.person-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.person-details .tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.25rem;
}

.person-details .weak-tag {
    display: inline-block;
    background: #e8f5e8;
    color: #2e7d2e;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.25rem;
}

.person-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Move Board Modal Styles */
.move-board-form {
    padding: 1rem;
}

.move-info {
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-controls {
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }
    
    .kanban-board {
        flex-direction: column;
    }
    
    .column {
        min-width: auto;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .overview-controls {
        flex-direction: column;
        height: auto;
    }
    
    .filter-section {
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .person-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .person-actions {
        flex-direction: column;
    }
}