:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #f59e0b;
    --accent-bright: #fbbf24;
    --bg-base: #0f1419;
    --bg-elevated: #1a1f2e;
    --bg-card: #232938;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: #374151;
    --border-light: #2d3748;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    line-height: 1.2;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-elevated);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 100;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 32px 24px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-light);
    margin: 0;
    letter-spacing: -0.5px;
}

.tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 4px;
    font-weight: 300;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
    padding: 0 16px;
}

.nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    padding: 0 8px;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: rgba(255, 255, 255, 0.8);
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.project-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.project-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-light);
    flex-shrink: 0;
}

.project-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.btn-new-project {
    margin-top: 12px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-new-project:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-btn {
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-base);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.settings-btn,
.logout-btn {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.settings-btn:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.board-header {
    padding: 28px 32px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.board-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.board-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.board-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    width: 240px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

/* Board Container */
.board-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 24px 32px;
}

.kanban-board {
    display: flex;
    gap: 16px;
    min-width: min-content;
    height: 100%;
}

.kanban-column {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.column-header {
    padding: 16px 16px 12px;
    border-bottom: 2px solid var(--border-light);
    transition: var(--transition);
}

.column-header:hover {
    background: var(--bg-card);
}

.column-header:hover .add-task-hint {
    opacity: 1;
}

.add-task-hint {
    font-size: 11px;
    color: var(--primary-light);
    margin-top: 4px;
    opacity: 0;
    transition: var(--transition);
}

.column-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.task-count {
    background: var(--bg-base);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.column-tasks {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.task-card.dragging {
    opacity: 0.5;
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.task-priority {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

.task-priority.Low {
    background: var(--text-muted);
}

.task-priority.Medium {
    background: var(--warning);
}

.task-priority.High {
    background: var(--accent-bright);
}

.task-priority.Urgent {
    background: var(--error);
}

.task-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.task-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-base);
    color: var(--text-secondary);
}

.task-assignee {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.task-due {
    font-size: 11px;
    color: var(--text-muted);
}

.task-due.overdue {
    color: var(--error);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
}

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

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

.btn-link {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}

.btn-link:hover {
    background: var(--bg-base);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.icon {
    font-size: 18px;
    line-height: 1;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-elevated);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h3 {
    font-size: 20px;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-base);
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

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

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.task-title-input {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    border: none;
    padding: 0;
    font-family: 'Fraunces', serif;
}

.task-title-input:focus {
    outline: none;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

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

/* Comments */
.comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

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

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.comment-input-box {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#commentInput {
    min-height: 60px;
}

/* Activity Log */
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-left: 2px solid var(--border);
    padding-left: 12px;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Checklist */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.checklist-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checklist-item input[type="text"] {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    padding: 4px;
}

.checklist-item button {
    padding: 4px 8px;
    font-size: 12px;
}

/* Settings */
.settings-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

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

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

.tab-content {
    display: none;
}

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

.user-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.user-item-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.user-item-actions {
    display: flex;
    gap: 8px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

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

.alert-success {
    background: #efe;
    color: var(--success);
    border: 1px solid #cfc;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #232938 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-elevated);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-family: 'Fraunces', serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Utilities */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 1001;
        transition: left 0.3s;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .kanban-column {
        width: 280px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
