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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --bg-card: #2a2a2a;
    --bg-hover: #333333;
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    --accent-blue: #4facfe;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    
    --border-color: #404040;
    --border-hover: #505050;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

.restore-btn:hover {
    background: #3a8bfe;
}

.subtasks-container {
    padding: 1rem 1.5rem 1rem 3rem;
    background: transparent;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: var(--text-primary);
}

.app-background {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
}

.container {
    max-width: 800px;
    width: 100%;
    background: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

header {
    background: transparent;
    color: var(--text-primary);
    padding: 1rem 0 2rem;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Quotes Section */
.quotes-section {
    margin-bottom: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-container {
    max-width: 600px;
    margin: 0 auto;
}

.quote-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    line-height: 1.6;
    animation: fadeIn 0.8s ease-in-out;
    transition: opacity 0.3s ease-in-out;
}

.quote-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    animation: fadeIn 0.8s ease-in-out 0.2s both;
    transition: opacity 0.3s ease-in-out;
}

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

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nj-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nj-logo:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #5bb6ff 0%, #9c6bff 100%);
}

.app-logo h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.search-section {
    margin-bottom: 1rem;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    z-index: 2;
}

#searchInput {
    width: 100%;
    padding: 1rem 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.add-task-section {
    margin-bottom: 1rem;
}

.new-task-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.new-task-btn:hover {
    background: #3a8bfe;
}

.inline-task-input {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 8px;
    margin-top: 0.5rem;
}

#taskTitleInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

#taskTitleInput::placeholder {
    color: var(--text-muted);
}

.inline-task-actions {
    display: flex;
    gap: 0.25rem;
}

.save-task-btn, .cancel-task-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.save-task-btn {
    background: var(--accent-green);
    color: white;
}

.save-task-btn:hover {
    background: #059669;
}

.cancel-task-btn {
    background: var(--accent-red);
    color: white;
}

.cancel-task-btn:hover {
    background: #dc2626;
}

.tasks-container {
    background: transparent;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    font-style: italic;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 0;
}

.empty-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.75rem;
    font-weight: normal;
    opacity: 0.8;
}

.task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1rem;
}

.task-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.task-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    gap: 1rem;
}

.task-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-blue);
    border-radius: 3px;
    flex-shrink: 0;
}

.expand-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.expand-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.task-text-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.task-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    cursor: text;
    padding: 0;
    line-height: 1.4;
}
.task-text:focus {
    outline: 1px solid var(--accent-blue);
    outline-offset: 2px;
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.edit-task-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.edit-task-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.subtask-count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.task-details {
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    justify-content: flex-end;
    padding: 0 1.5rem 1rem;
}

.task-actions-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.plan-for-me-btn, .add-subtask-btn, .edit-btn, .delete-btn, .restore-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.plan-for-me-btn {
    background: var(--accent-purple);
    color: white;
}

.plan-for-me-btn:hover {
    background: #7c3aed;
}

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

.add-subtask-btn {
    background: var(--accent-green);
    color: white;
}

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

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

.edit-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.delete-btn {
    background: var(--accent-red);
    color: white;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.restore-btn {
    background: var(--accent-blue);
    color: white;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.restore-btn:hover {
    background: #3a8bfe;
}

.subtasks-container {
    padding: 1rem 1.5rem 1rem 3rem;
    background: transparent;
}

.subtask-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.subtask-item:last-child {
    margin-bottom: 0;
}

.subtask-item:hover {
    background: var(--bg-hover);
}

.subtask-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-green);
    border-radius: 3px;
    flex-shrink: 0;
}

.subtask-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    outline: none;
    cursor: text;
    padding: 0;
    line-height: 1.4;
}

.subtask-text:focus {
    outline: 1px solid var(--accent-blue);
    outline-offset: 2px;
    color: var(--text-primary);
}

.subtask-text.completed {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.7;
}

.ai-badge {
    background: var(--accent-purple);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.subtask-delete-btn {
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subtask-delete-btn:hover {
    background: #dc2626;
}

.add-subtask-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.add-subtask-input:focus {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.add-subtask-input::placeholder {
    color: var(--text-muted);
}

/* Scrollbar styling */
.tasks-container::-webkit-scrollbar {
    width: 8px;
}

.tasks-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tasks-container::-webkit-scrollbar-thumb {
    background: #4facfe;
    border-radius: 10px;
}

.tasks-container::-webkit-scrollbar-thumb:hover {
    background: #3a8bfe;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .add-task-section {
        padding: 20px 20px 15px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    #addTaskBtn {
        width: 100%;
    }
    
    .tasks-container {
        padding: 15px 20px 25px;
    }
    
    .task-content {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tasks-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tasks-header h2 {
        font-size: 1.25rem;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
        min-width: auto;
    }
    
    .task-stats {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .task-content {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .task-info {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .task-text-container {
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .task-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .add-subtask-btn, .plan-for-me-btn, .delete-btn {
        font-size: 0.6875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .subtasks-container {
        padding-left: 20px;
        padding-right: 15px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    background: var(--primary);
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 300;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    background-color: var(--card-bg);
}

.setting-group {
    margin-bottom: 25px;
}

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

.setting-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.setting-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.setting-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.test-btn, .save-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.save-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cancel-btn, .create-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.create-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.setting-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.setting-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.connection-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.connection-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.connection-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.connection-status.testing {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    border: 1px solid rgba(79, 172, 254, 0.2);
}
