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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Global theme variables are defined in :root */
    background: var(--bg-color, rgba(245,247,250,0.5));
    min-height: 100vh;
    padding: 20px;
}

:root {
    --bg-color: rgba(245,247,250,0.6);
    --card-bg: #ffffff;
    --muted: #666666;
    --primary: #667eea;
    --accent: #4a90e2;
    --success: #4caf50;
    --danger: #ff4757;
    --header-bg-start: #232526;
    --header-bg-end: #414345;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
    color: white;
    padding: 25px 30px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.app-logo {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
  
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px dotted rgba(255, 255, 255, 0.15);
}

.app-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    display: block;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-text h1,
header h1 {
    font-size: 1.9em;
    margin-bottom: 3px;
    line-height: 1.2;
    font-weight: 600;
}

.header-text p,
header p {
    font-size: 0.88em;
    opacity: 0.85;
    margin-bottom: 5px;
    line-height: 1.4;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78em;
    margin-top: 3px;
}

.header-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    font-size: 0.7em;
    white-space: nowrap;
}

.header-domain {
    opacity: 0.75;
    font-family: monospace;
    font-size: 0.75em;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
    white-space: nowrap;
}

.logout-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* keep header h1/p selectors for backward compatibility via .header-text rules above */

.back-btn {
    padding: 10px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.back-btn:hover {
    background: #357abd;
    transform: translateX(-3px);
}

/* Metrics Dashboard */
.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid #dee2e6;
}

.metric-card {
    background: white;
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.metric-card-wide {
    grid-column: span 2;
}

.metric-card-fullwidth {
    grid-column: 1 / -1;
}

.activity-graph-card {
    padding: 15px 20px;
}

#activityGraph {
    width: 100%;
    height: 150px;
    max-height: 150px;
}

.metric-icon {
    font-size: 2em;
    line-height: 1;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
    margin-bottom: 3px;
}

.metric-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.metric-progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.metric-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease, background 0.5s ease;
}

@media (max-width: 1200px) {
    .metrics-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .metrics-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-card-wide {
        grid-column: span 2;
    }

    .metric-card-fullwidth {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .metrics-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .metrics-dashboard {
        grid-template-columns: 1fr;
    }

    .metric-card-wide {
        grid-column: span 1;
    }
}

.task-input-section {
    padding: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.task-input-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.input-hint {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Sub-task Tabs */
.subtask-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.subtask-tab {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.subtask-tab:hover {
    color: #4a90e2;
    background: #f7fafc;
}

.subtask-tab.active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
    background: #f7fafc;
}

.subtask-tab-content {
    display: none;
}

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

#subTaskName {
    flex: 2;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#subTaskName:focus {
    outline: none;
    border-color: #4caf50;
}

.form-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#taskName {
    flex: 2;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#taskName:focus {
    outline: none;
    border-color: #4caf50;
}

#parentTask {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    background: white;
}

.primary-btn {
    padding: 12px 30px;
    background:#414345;  /* Soft relaxed blue */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    background: #414345; /* Lighter relaxed blue */
    transform: translateY(-1px);
}

.primary-btn:active {
    background: #414345; /* Slightly darker when active */
    transform: translateY(0);
}

.secondary-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.secondary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn:active {
    transform: translateY(0);
}

.task-tree-section {
    padding: 30px;
}

.task-tree-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.tree-container {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    min-height: 200px;
}

.tree-container.drop-zone-root {
    border: 3px dashed #667eea;
    background: #f0f4ff;
}

/* Task Status Bar */
.task-status-bar-container {
    margin-bottom: 20px;
}

.task-status-bar {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.status-bar-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-bar-progress {
    flex: 1;
}

.status-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-bar-progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-bar-progress-bar {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.status-bar-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status-bar-progress-text {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 50px;
    text-align: right;
}

.status-bar-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.status-bar-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-bar-stat-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.status-bar-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.status-bar-stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-bar-stat-badge.status-complete {
    background: #4caf50;
    color: white;
}

.status-bar-stat-badge.status-progress {
    background: #ffa726;
    color: white;
}

.status-bar-stat-badge.status-pending {
    background: #9e9e9e;
    color: white;
}

.status-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.status-bar-reset-btn {
    padding: 8px 16px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-bar-reset-btn:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.status-bar-reset-btn:active {
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

.tree-node {
    margin: 10px 0;
    position: relative;
}

.tree-node-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.tree-node-content:hover {
    border-color: #667eea;
    transform: translateX(3px);
}

.tree-node-content.completed {
    background: #f0f7f0;
    border-color: #4caf50;
}

.tree-node-content.completed .task-name {
    text-decoration: line-through;
    color: #666;
}

.tree-node-content.active {
    background: linear-gradient(90deg, #fff3cd 0%, #ffffff 100%);
    border-color: #ffc107;
    border-width: 3px;
}

.tree-node-content.active:hover {
    border-color: #ffa000;
}

.active-indicator {
    color: #ffc107;
    font-size: 18px;
    font-weight: bold;
    margin-left: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.tree-node-content .task-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.drag-handle {
    cursor: grab;
    color: #999;
    font-size: 16px;
    padding: 0 5px;
    user-select: none;
    transition: color 0.3s;
}

.drag-handle:hover {
    color: #667eea;
}

.drag-handle:active {
    cursor: grabbing;
}

.tree-node-content.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.tree-node-content.drop-zone {
    border-color: #4caf50;
    border-width: 3px;
    background: #f0f7f0;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.tree-node-content.drop-zone-child {
    border-color: #2196f3;
    background: #e3f2fd;
}

.tree-node-content.drop-zone-sibling-before::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff9800;
    border-radius: 2px;
}

.tree-node-content.drop-zone-sibling-after::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff9800;
    border-radius: 2px;
}

.drop-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tree-node-content .task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-subtask-btn {
    padding: 5px 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.add-subtask-btn:hover {
    background: #45a049;
}

.edit-btn {
    padding: 5px 12px;
    background: #9c27b0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.edit-btn:hover {
    background: #7b1fa2;
}

.clone-btn {
    padding: 5px 12px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.clone-btn:hover {
    background: #138496;
}

.delete-btn {
    padding: 5px 12px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

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

.toggle-btn {
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.toggle-btn:hover {
    background: #5568d3;
}

.tree-children {
    margin-left: 40px;
    padding-left: 20px;
    border-left: 2px solid #667eea;
    position: relative;
}

.tree-children::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #667eea 0%, transparent 100%);
}

.tree-children.collapsed {
    display: none;
}

.subtask-count {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    font-weight: bold;
    color: #667eea;
    min-width: 35px;
    text-align: right;
}

/* Card List View Styles */
.card-list-section {
    padding: 30px;
}

.card-list-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Completed Tasks Section */
.completed-tasks-section {
    margin-top: 40px;
    padding: 20px 30px;
    border-top: 2px solid #e0e0e0;
}

.completed-section-header {
    font-size: 1.1em;
    color: #999;
    margin-bottom: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completed-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.completed-task-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    opacity: 0.7;
    transition: all 0.2s;
    font-size: 14px;
}

.completed-task-line:hover {
    opacity: 1;
    background: #f0f0f0;
    border-color: #dee2e6;
}

.completed-task-name {
    flex: 1;
    color: #666;
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 15px;
}

.completed-task-meta {
    color: #999;
    font-size: 12px;
    margin-right: 15px;
    white-space: nowrap;
}

.completed-task-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.completed-task-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 8px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.2s;
    line-height: 1;
}

.completed-task-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.task-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.task-card.active-card {
    border-color: #ffc107;
    border-width: 3px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
}

.task-card.completed-card {
    opacity: 0.6;
    background: #f7f7f7;
    border-color: #d0d0d0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.card-title {
    color: #333;
    font-size: 1.5em;
    margin: 0;
    flex: 1;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pin-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.3s;
    line-height: 1;
    /* Unpinned state: grayscale and faded */
    opacity: 0.4;
    filter: grayscale(100%) brightness(0.7);
}

.pin-btn:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
    filter: grayscale(50%) brightness(0.9);
}

.pin-btn.pinned {
    /* Pinned state: full color, vibrant, with background */
    opacity: 1;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    filter: grayscale(0%) brightness(1.2) drop-shadow(0 0 3px rgba(255, 193, 7, 0.6));
    transform: scale(1.05);
}

.pin-btn.pinned:hover {
    transform: scale(1.15);
    background: rgba(255, 193, 7, 0.25);
    border-color: rgba(255, 193, 7, 0.5);
    filter: grayscale(0%) brightness(1.3) drop-shadow(0 0 5px rgba(255, 193, 7, 0.9));
}

.card-active-badge {
    background: #ffc107;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 1.5s ease-in-out infinite;
}

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: bold;
}

.stat-value {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.card-progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 5px 0;
}

.card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-complete {
    background: #4caf50;
    color: white;
}

.status-progress {
    background: #2196f3;
    color: white;
}

.status-pending {
    background: #9e9e9e;
    color: white;
}

.card-subtasks-header {
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.card-toggle-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-toggle-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.card-subtasks-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.card-subtasks-container.collapsed {
    display: none;
}

.card-task-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-tree-node {
    margin-bottom: 8px;
}

.card-tree-node-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
}

.card-tree-node-content:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.card-tree-node-content.active {
    background: linear-gradient(90deg, #fff3cd 0%, #ffffff 100%);
    border-color: #ffc107;
    border-width: 2px;
}

.card-tree-node-content.completed .task-name {
    text-decoration: line-through;
    color: #666;
}

.card-tree-node-content .task-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.card-tree-node-content .task-name:hover {
    color: #667eea;
}

.card-tree-node-content .task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-tree-node-content .task-actions button {
    padding: 4px 10px;
    font-size: 12px;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.card-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.card-btn-primary {
    background: #45a049;
    color: white;
}

.card-btn-primary:hover {
    transform: translateY(-1px);
}

.card-btn-secondary {
    background: #ffc107;
    color: white;
}

.card-btn-secondary:hover {
    background: #ffa000;
    transform: translateY(-2px);
}

.card-btn-edit {
    background: #9c27b0;
    color: white;
}

.card-btn-edit:hover {
    background: #7b1fa2;
    transform: translateY(-1px);
}

.card-btn-clone {
    background: #17a2b8;
    color: white;
}

.card-btn-clone:hover {
    background: #138496;
    transform: translateY(-1px);
}

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

.card-btn-danger:hover {
    background: #ff3838;
    transform: translateY(-2px);
}

.drag-handle-card {
    cursor: grab;
    color: #999;
    font-size: 14px;
    padding: 5px;
    user-select: none;
    transition: color 0.3s;
    display: inline-block;
    margin-right: 10px;
}

.drag-handle-card:hover {
    color: #667eea;
}

.drag-handle-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.task-card.drop-zone-card {
    border-color: #4caf50;
    border-width: 3px;
    background: #f0f7f0;
}

.cards-container.drop-zone-root {
    border: 3px dashed #667eea;
    background: #f0f4ff;
    border-radius: 8px;
    padding: 20px;
}

@media (max-width: 768px) {
    header {
        padding: 20px 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .header-left {
        width: 100%;
        gap: 12px;
    }
    
    .app-logo {
        width: 40px;
        height: 40px;
    }
    
    .header-text h1,
    header h1 {
        font-size: 1.6em;
    }
    
    .header-text p,
    header p {
        font-size: 0.85em;
    }
    
    .header-meta {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .header-user {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding-bottom: 10px;
        width: 100%;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .logout-btn {
        width: 100%;
        margin-top: 10px;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .card-stats {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 24px;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 16px;
    line-height: 1.5;
}

#modalInput {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

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

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

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.modal-btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

.modal-btn:active {
    transform: translateY(0);
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    margin-top: 60px;
    padding: 50px 0 20px;
    border-top: 1px solid #4a5568;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section p {
    color: #a0aec0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.footer-links a {
    color: #4a90e2;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #63b3ed;
    text-decoration: underline;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 10px;
}

.footer-list a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-list a:hover {
    color: #4a90e2;
}

.footer-text {
    margin-bottom: 15px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    display: inline-block;
    font-size: 24px;
    text-decoration: none;
    transition: transform 0.3s;
}

.footer-social a:hover {
    transform: scale(1.2);
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom p {
    color: #718096;
    font-size: 14px;
    margin: 0;
}

.footer-domain {
    color: #4a90e2;
    font-weight: 600;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
