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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    overflow: hidden;
}

/* Login Screen */
.login-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

#loginForm input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

#loginForm input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
}

/* App Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 1.5em;
}

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

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.settings-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.settings-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2em;
    color: #333;
}

.search-box {
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.project-tree {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.project-tree mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.project-item {
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.project-item:hover {
    background: #f5f7fa;
}

.project-item.active {
    background: #667eea;
    color: white;
}

.project-item.nested {
    margin-left: 20px;
}

.project-actions {
    display: flex;
    gap: 5px;
}

.project-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.project-actions button:hover {
    opacity: 1;
}

/* Kanban Area */
.kanban-area {
    flex: 1;
    overflow-x: auto;
    background: #f5f7fa;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.kanban-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-columns {
    display: flex;
    gap: 20px;
    padding: 20px;
    height: calc(100% - 80px);
    overflow-x: auto;
}

.kanban-column {
    background: white;
    border-radius: 8px;
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.column-header {
    padding: 15px;
    border-bottom: 2px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    color: #333;
    font-size: 1em;
}

.column-cards {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.card {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: move;
    border-left: 4px solid #667eea;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 8px;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg);
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-edit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.card-edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: #5568d3;
}

.card:not(:hover) .card-edit-btn {
    opacity: 0.5;
}

/* Drop zones */
.drop-zone {
    min-height: 8px;
    margin: 4px 0;
    transition: all 0.2s;
    border-radius: 3px;
}

.drop-zone.active {
    min-height: 20px;
    background: transparent;
    border: 2px dashed transparent;
}

.drop-zone.drag-over {
    background: #e8f0ff;
    border-color: #667eea;
    min-height: 30px;
}

.column-cards.drag-over {
    background: #e8f0ff;
    border: 2px dashed #667eea;
    border-radius: 5px;
}

.card-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.card-description {
    color: #666;
    font-size: 0.9em;
}

.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 8px;
    margin-bottom: 4px;
    color: #333;
}

.markdown-content h1 { font-size: 1.4em; }
.markdown-content h2 { font-size: 1.3em; }
.markdown-content h3 { font-size: 1.2em; }
.markdown-content h4 { font-size: 1.1em; }
.markdown-content h5 { font-size: 1em; }
.markdown-content h6 { font-size: 0.9em; }

.markdown-content p {
    margin: 4px 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 4px 0;
    padding-left: 20px;
}

.markdown-content li {
    margin: 2px 0;
}

.markdown-content code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #f4f4f4;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 3px solid #667eea;
    padding-left: 10px;
    margin: 8px 0;
    color: #666;
    font-style: italic;
}

.markdown-content a {
    color: #667eea;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 8px 0;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #ddd;
    padding: 4px 8px;
    text-align: left;
}

.markdown-content table th {
    background: #f4f4f4;
    font-weight: bold;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

.markdown-content strong {
    font-weight: bold;
    color: #333;
}

.markdown-content em {
    font-style: italic;
}

/* Buttons */
button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

button:hover {
    background: #5568d3;
}

.primary-btn {
    background: #28a745;
}

.primary-btn:hover {
    background: #218838;
}

.add-btn {
    background: #667eea;
    padding: 8px 16px;
    font-size: 13px;
}

.cancel-btn {
    background: #6c757d;
}

.cancel-btn:hover {
    background: #5a6268;
}

.delete-btn {
    background: #dc3545;
    padding: 5px 10px;
    font-size: 12px;
}

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

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
